0

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'
);
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.