1

Is it possible to do a pg_dump --schema-only of the database schema but not include any username/password combinations that are in user mappings?

For example, I would like items such as the following to not be put in the dump:

CREATE USER MAPPING FOR greg SERVER db_name OPTIONS (
 password 'supersecret',
 username 'bobs_uncle'
);
asked Jun 1, 2018 at 21:51

1 Answer 1

1

The only thing I can think of is to create a single-purpose non-super user and grant them read access to all the objects in the database. Then run pg_dump connected as that user. Perhaps not the most elegant solution.

answered Jun 2, 2018 at 14:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.