BUG #13987: Refreshing materialized view prevents changing rights during restore

From: martin(dot)klima(at)warhorsestudios(dot)cz
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13987: Refreshing materialized view prevents changing rights during restore
Date: 2016-02-24 16:36:56
Message-ID: 20160224163656.2568.64179@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13987
Logged by: Martin Klima
Email address: martin(dot)klima(at)warhorsestudios(dot)cz
PostgreSQL version: 9.4.1
Operating system: Warhorse
Description:

I created dump of the database with pg_dump. When restoring it via psql, I
got the error "permission denied for relation ...". Upon checking the
problem, I realized that in the SQL file generated by the pg_dump, there is
command REFRESH MATERIALIZED VIEW ... just before the section (at the very
end of the dump) where the rights for the tables are first revoked and then
granted. The table mentioned in the error message is one of the tables the
materialized view is running.

My theory is that the refresh locks the table and therefore the REVOKE ALL
command fails. When I commented out the REFRESH MATERIALIZED VIEW commands,
the restore run without a problem (I then refreshed the views manually).

The command I run to create the dump was:

pg_dump -h<ip_address> -ntrunk -v -f d:\temp\dump.sql ConfigDB
>d:\temp\dump.log 2>&1

And restore with:

psql --single-transaction -h<ip_address> -f d:\temp\dump.sql ConfigDB
>out.log 2>error.log

Cheers,
Martin

Browse pgsql-bugs by date

  From Date Subject
Next Message Kasahara Tatsuhito 2016-02-24 17:53:05 Re: BUG #13979: Strange pg_stat_statements results with PREPARE/EXECUTE
Previous Message Oleksii Kliukin 2016-02-24 15:54:00 Re: BUG #13977: Strange behavior with WAL archive recovery