I did a backup with pg_dump of a database called database_a (whose PostgreSQL owner was ubuntu) in the server A. I called database_a_bkp.dump to the resultant file.
Afterwards, I went to other server B. In this server B, there was another different database also called database_a, whose PostgreSQL owner was odoo. But I created a new one named database_b, whose owner was ubuntu, to do the restoration there.
I executed the following command:
pg_restore --create --clean -U ubuntu -d database_b database_a_bkp.dump However, unfortunately, this command altered the database_a, instead of restoring data in database_b. The database_a owner changed to ubuntu. I needed to move the owner to odoo again and do a REASSIGN OWNED query.
But there were more changes. For example, so far I realized that the nextval of the ID pg_sequences has changed, resulting in a lot of errors in database_a.
How is this possible? What was the mistake? I can fix those nextval, but I'm afraid of those are not the only things that the pg_restore has changed. Does anyone know the reason and how many things can have been altered in database_a?