[GENERAL] pg_restore misuse or bug? - Mailing list pgsql-general

From Jordan Gigov
Subject [GENERAL] pg_restore misuse or bug?
Date
Msg-id CA+nBocAmQ+OPNSKUzaaLa-6eGYVw5KqexWJaRoGvrvLyDir9gg@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] pg_restore misuse or bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
So we have this database dump created using "pg_dump -Fc ourdb >
file.dump" that has a Materialized View that gets refreshed under
certain conditions by our Java web-app.

When running pg_restore as the superuser it gives the following error
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3253; 0 320628
MATERIALIZED VIEW DATA combined_query_data web_user
pg_restore: [archiver (db)] could not execute query: ERROR:
permission denied for relation first_table_in_from_list
    Command was: REFRESH MATERIALIZED VIEW combined_query_data;

If we run it as "pg_restore -d ourdb file.dump" it is treated as a
warning, and the restore is successful, except for the data in the MV.
We have to run the command separately in order to fill the data.
If we run it as "pg_restore -d ourdb -1 file.dump", then it becomes a
fatal error and rolls back the transaction.

I see no reason why the superuser would get a "permission denied"
error. Is this a bug or am I doing something wrong.


pgsql-general by date:

Previous
From: Scott Mead
Date:
Subject: Re: [GENERAL] Logging at schema level
Next
From: basti
Date:
Subject: [GENERAL] pg_dump and insert json with copy