I have a postgres 9.6. I am using pg_dumpall
with -c --if-exists
options.
When I restore from this backup file as the superuser I am getting errors current user cannot be dropped
when it tries to drop the role. And after that I am getting role "mysuperuser" already exists
when it tries to create the superuser role.
These two errors does not effect the success of the restore. However, I do not want to get irrelevant errors like these.
What I can do is to remove the two lines which are dropping and creating the aforementioned superuser role.
Is there a better way to do this? Because in order to achieve that I need to open a huge file and edit it.