pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jgpedro@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #12898: Failure loading materialized view with pg_restore
Date: Wed, 25 Mar 2015 15:48:12 +0000
Message-ID: <20150325154812.2490.65573@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      12898
Logged by:          José Pedro
Email address:      jgpedro@gmail.com
PostgreSQL version: 9.3.6
Operating system:   Ubuntu 14.04.2 LTS 64-bit
Description:        

pg_restore of a materialized view fails with "permission denied for relation
<X>".

The same problem as discussed in this thread:

http://www.postgresql.org/message-id/flat/11166.1424357659@sss.pgh.pa.us#11166.1424357659@sss.pgh.pa...

Problem identified as: 

- Tables ACLs restored after materialized views creation;

- Owner of materialized view only gets permission to table after the ACLs
being restored.

As Tom Lane said
(http://www.postgresql.org/message-id/11166.1424357659@sss.pgh.pa.us):

"We need to rethink the ordering rules here.  I believe that not dumping
ACLs till late is an intentional choice to avoid corner cases with regular
tables (eg what if user has revoked INSERT on a table), but it doesn't
work so well for matviews.

One possible avenue to a fix is to also postpone the assignment of the
matview's owner, but I'm not sure that that's a great idea from a security
standpoint.

A possibly safer idea is just to put all REFRESHes after all ACL updates.
If things fail then, well, they'd have failed anyway."


I'm opening a bug report so this issue won't be forgotten ;)


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



Message-ID: <20150325154812.2490.65573@wrigleys.postgresql.org>
Permalink:  ../20150325154812.2490.65573@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150325154812.2490.65573@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jgpedro@gmail.com
  Subject: Re: BUG #12898: Failure loading materialized view with pg_restore
  In-Reply-To: <20150325154812.2490.65573@wrigleys.postgresql.org>
  References: <20150325154812.2490.65573@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox