My database is associated with different usernames on the server and on my local machine. Whenever I try to restore it on my local machine from the backup downloaded from the server using the command
psql -d dbname -f backupfile.sql
I get the error output saying that
ERROR: role "myusername" does not exist
Despite the error message, the actual restore goes through. But it is annoying to see multiple error messages saying the same thing (once for each table). Is there a way I can suppress this error message. I searched quite a bit but could not find anything. There is
no-owner option for
pgrestore, but I could not find anything for psql.
Thank you for your help.