Re: pg_dump broken for non-super user - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: pg_dump broken for non-super user
Date
Msg-id 20160507141411.GL10850@tamriel.snowman.net
Whole thread Raw
In response to Re: pg_dump broken for non-super user  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: pg_dump broken for non-super user  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon,

* Simon Riggs (simon@2ndQuadrant.com) wrote:
> On 4 May 2016 at 16:45, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Why is it that we need to lock a table at all if we're just going to dump
> > its ACL?
>
> We don't, but surely that's the wrong question.

I tend to agree with this, however...

> If we don't lock it then we will have a inconsistent dump that will fail
> later, if dumped while an object is being dropped.
> Do we want an inconsistent dump?

The dump won't be inconsistent, as Tom pointed out.  The catalog tables
are read using a repeatable read transaction, which will be consistent.

> For what reason are we changing existing behaviour? There is no bug here,
> as Stephen explained.
>
> So this is a behaviour change after freeze with uncertain purpose.

This isn't accurate.  We never locked tables in pg_catalog before, as we
never looked at them, and that's currently the only case where the new
logic will apply.  We may change the behavior for --no-privileges (and
perhaps other options) in the future to also have this logic apply, but
I agree that's 9.7 material.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Reviewing freeze map code
Next
From: Simon Riggs
Date:
Subject: Re: pg_dump broken for non-super user