Re: pg_dump / restore of empty database gives errors - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump / restore of empty database gives errors
Date
Msg-id 10836.1046023236@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump / restore of empty database gives errors  (Rod Taylor <rbt@rbt.ca>)
Responses Re: pg_dump / restore of empty database gives errors  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Rod Taylor <rbt@rbt.ca> writes:
>>> ERROR:  dependent privileges exist (use CASCADE to revoke them too)
>>
>> I saw that a couple weeks ago, and then was unable to reproduce it later

> Seems to be by design.  Create an empty schema with no permissions.
> First REVOKE sees lack of permissions, and adds them for the owner.  The
> GRANT makes PUBLIC dependent on the owner for permissions.  The second
> REVOKE attempts to remove the permissions of the owner (replace
> CURRENT_USER with the current user) which PUBLIC is now dependent upon.

Hmm.  So the real story here is that the permissions set up by initdb
for PUBLIC are actually an illegal state: postgres has granted
permissions to public that it isn't allowed to.  When pg_dump tries to
reproduce that state, it can't.  (There may also be an issue with the
order in which pg_dump issues its revoke/grant operations, ie, there
might be legal combinations that it can't reproduce.)  Peter, what
do you think?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: pg_dump / restore of empty database gives errors
Next
From: "Sumaira Ali"
Date:
Subject: locking mechanism