pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <kgrittn@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: marian.krucina@gmail.com, PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13907: Restore materialized view throw permission denied
Date: Tue, 26 Jul 2016 14:30:06 -0400
Message-ID: <30371.1469557806@sss.pgh.pa.us> (raw)
In-Reply-To: <CACjxUsPu8uNHYvTtUa9v3k6nOnG+w7cc4Kr2xVagB5cUEbfBDQ@mail.gmail.com>
References: <20160202161407.2778.24659@wrigleys.postgresql.org>
	<CAB7nPqR-r8HMhEtEkGTr-N4kVrAJLqj-OP0wyjVin0U0BWsu5A@mail.gmail.com>
	<22633.1465910990@sss.pgh.pa.us>
	<CAB7nPqTVtZ0vWUSa4sQUFSZvkp0xacw2oojmhYSwi85SP45d9w@mail.gmail.com>
	<CAB7nPqQFLsrHDG=+6R6jw7QG9e9drk5aPsBtzsVpGuaF3VrXtQ@mail.gmail.com>
	<1152.1466094507@sss.pgh.pa.us>
	<CAB7nPqT0WSgO3V31pAL7QvmxMgxUPFsioFFbfON6SYpqEVOzrg@mail.gmail.com>
	<21147.1467052547@sss.pgh.pa.us>
	<CACjxUsNmpQDL58zRm3EFS9atqGT8+X_2+FOCXpYBwWZw5wgi-A@mail.gmail.com>
	<9af4bc32-7e55-a21d-47e7-608582a8c48d@2ndquadrant.com>
	<CACjxUsPUNgVp-VWrcdCDRdupE58TN-GuCfQ_4HJw_Wee1rVa3Q@mail.gmail.com>
	<5850.1469541250@sss.pgh.pa.us>
	<CACjxUsM4TReQKrHq7CGrZEgMqDWFuo01KqUNgDcwU0aob_SyBg@mail.gmail.com>
	<17767.1469546034@sss.pgh.pa.us>
	<CACjxUsOzazsa7mFxEXs+TU=F_zv7ZdRR86i_2OF_+ZxOYB1Yvg@mail.gmail.com>
	<26375.1469554367@sss.pgh.pa.us>
	<CACjxUsPu8uNHYvTtUa9v3k6nOnG+w7cc4Kr2xVagB5cUEbfBDQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Kevin Grittner <kgrittn@gmail.com> writes:
> On Tue, Jul 26, 2016 at 12:32 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It's possible that the most reasonable fix is to move matview refreshes to
>> after the ACL restoration step.  That would wreak a lot of havoc with
>> the current view of a dump as being tripartite (pre-data/data/post-data),
>> so it might be more work than we want to do.  But it seems like the
>> logically soundest thing.

> That is exactly what the patch I posted yesterday does.  Peter was
> suggesting that wasn't good enough

Well, he's right: just minimally rearranging the dump order is not enough.
For one thing, I'm pretty sure this patch will fail to fix the bug in a
parallel restore, because restore_toc_entries_parallel has hard-wired
knowledge that ACLs can be done last and serially.  Even if the fix works
in parallel restore, it would result in doing matview refreshes serially
not in parallel, which is a pretty tough nut to swallow.  And I'm not
really convinced that the patch preserves dependency ordering requirements
at all, even in plain serial restore.

The core of the problem here, I think, is that pg_dump has never had any
real notion of dependency ordering for ACLs, since it's always been
sufficient to dump them at the very end in arbitrary order.  If we're now
going to make objects-with-dependencies also dependent on ACLs, I'm afraid
that raises the bar quite a lot in terms of needing to treat ACLs as
real, dependency-sorted objects.

I believe the thrust of Peter's suggestion is to try to avoid biting that
bullet, by instead instituting a rule of "dump an object's ACL immediately
after the object".  But to make this work with the read-only-table
scenario, it would have to be something like "dump an object's GRANTs
immediately after the object, but if there are any self-revokes, dump
those last as we always have".

With either approach, I'm afraid we're talking about a patch much larger
and more invasive than what's here :-(

			regards, tom lane


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



view thread (21+ messages)  latest in thread

Message-ID: <30371.1469557806@sss.pgh.pa.us>
Permalink:  ../30371.1469557806@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30371.1469557806@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, kgrittn@gmail.com, peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com
  Subject: Re: BUG #13907: Restore materialized view throw permission denied
  In-Reply-To: <30371.1469557806@sss.pgh.pa.us>
  References: <20160202161407.2778.24659@wrigleys.postgresql.org> <CAB7nPqR-r8HMhEtEkGTr-N4kVrAJLqj-OP0wyjVin0U0BWsu5A@mail.gmail.com> <22633.1465910990@sss.pgh.pa.us> <CAB7nPqTVtZ0vWUSa4sQUFSZvkp0xacw2oojmhYSwi85SP45d9w@mail.gmail.com> <CAB7nPqQFLsrHDG=+6R6jw7QG9e9drk5aPsBtzsVpGuaF3VrXtQ@mail.gmail.com> <1152.1466094507@sss.pgh.pa.us> <CAB7nPqT0WSgO3V31pAL7QvmxMgxUPFsioFFbfON6SYpqEVOzrg@mail.gmail.com> <21147.1467052547@sss.pgh.pa.us> <CACjxUsNmpQDL58zRm3EFS9atqGT8+X_2+FOCXpYBwWZw5wgi-A@mail.gmail.com> <9af4bc32-7e55-a21d-47e7-608582a8c48d@2ndquadrant.com> <CACjxUsPUNgVp-VWrcdCDRdupE58TN-GuCfQ_4HJw_Wee1rVa3Q@mail.gmail.com> <5850.1469541250@sss.pgh.pa.us> <CACjxUsM4TReQKrHq7CGrZEgMqDWFuo01KqUNgDcwU0aob_SyBg@mail.gmail.com> <17767.1469546034@sss.pgh.pa.us> <CACjxUsOzazsa7mFxEXs+TU=F_zv7ZdRR86i_2OF_+ZxOYB1Yvg@mail.gmail.com> <26375.1469554367@sss.pgh.pa.us> <CACjxUsPu8uNHYvTtUa9v3k6nOnG+w7cc4Kr2xVagB5cUEbfBDQ@mail.gmail.com> <30371.1469557806@sss.pgh.pa.us>

* 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