1

I have a PostgreSQL database that is on my computer owned by postgres user and another database on a server, owned by a different user let's say user_server

I'm using pgAdmin.

  1. I create a backup on my computer using pgAdmin with the default settings (custom or tar).
  2. I connect to database on the server
  3. I execute a restore on the server database using the backup from my computer

After doing the operations, pgAdmin says that it fails, but the database looks ok. There are sometimes issues with sequences where the start number is lower than the max corresponding ID/PK.

I checked the logs and I have multiple errors, but all of them are similar to the following:

----
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3398; 0 0 COMMENT EXTENSION plpgsql 
pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql
    Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--------

pg_restore: [archiver (db)] Error from TOC entry 217; 1259 87892 TABLE association postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  must be member of role "postgres"
    Command was: ALTER TABLE public.association OWNER TO postgres;

----

pg_restore: [archiver (db)] Error from TOC entry 216; 1259 87890 SEQUENCE association_id_seq postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  must be member of role "postgres"
    Command was: ALTER TABLE public.association_id_seq OWNER TO postgres;

Looks like I'm having an issue because they are owned by 2 different users.

Can this be done from pgAdmin, like a setting to ignore users or do I need to modify something on the server?

1 Answer 1

1

pgAdmin backup dialog screen has option "Do not save owner".

Reference:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.