We have two PostgreSQL servers. On web server1 pguser1
is the associated user who creates all database objects required to work with the web application. Let's say, all objects are in schema1
.
Similarly, on server2 pguser2
creates data for Web server 2.
I have taken a schema backup (custom option in the backup window from pgadmin) from server1. When I restore to server2 I want all privileges and ownership of objects to be with pguser2
and nothing with pguser1
.
How can this be achieved? If possible, an option during during restore (pg_restore command) would be preferred.