0

I have set up Postgres and want to use

pg_dump -Fc mydb > dump.db

to copy the content of my db into a file. pg_dump is asking e for the System Users password, which does not work. I have never asked Postgres to use my system user as the default user. I'd be incredibly happy with the default user:postgres password:postgres, but Postgresql is making things hard for me. Any help is greatly appreciated. I do not need the system user in my pg database

2
  • 1
    then add the user name you want to use to the command: pg_dump -U postgres ... Commented Mar 29, 2021 at 13:53
  • @JGH Thanks! The flag actually works. but im running into this issue many times and would like to solve it without having to manually specify the user each time Commented Mar 29, 2021 at 14:29

1 Answer 1

2

You can customize the "defaults" by setting environment variables. PGUSER, PGPASSWORD. Be aware though that it may be possible for other users of the system to see your PGPASSWORD setting, so for that a .pgpass file would generally be preferred.

Sign up to request clarification or add additional context in comments.

1 Comment

can i get rid of the default system user by using .pgpass?

Your Answer

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.