I have postgresql installed in my Ubuntu 16.04 system. I am trying to take back up of database but it does not work,
user1@rajeshN ~ $ sudo pg_dump -U postgres teleshop_development1 > pg_backup
[sudo] password for user1:
pg_dump: [archiver (db)] connection to database "teleshop_development1" failed: FATAL: Peer authentication failed for user "postgres"
So I switched to postgres, And tried there but I do not know password
user1@rajeshN ~ $ sudo -i -u postgres
postgres@rajeshN:~$
postgres@rajeshN:~$ sudo pg_dump -U postgres teleshop_development1 > pg_backup
[sudo] password for postgres:
Sorry, try again.
Please suggest how can I get password or back up. Thanks in advance!