pg_restore: All GRANTs on table fail when any one role is missing

From: Moshe Jacobson <moshe(at)neadwerx(dot)com>
To: Postgres-Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: pg_restore: All GRANTs on table fail when any one role is missing
Date: 2018-07-12 19:48:04
Message-ID: CAJ4CxLn9EUTdqd3S9+n+HZxwNuE8vXOnAV+hOZv5M6WX7ovdeA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I have two clusters. The first cluster has user "user1" and the second
cluster does not.
I create a database in the first cluster and a table in that database.
I grant explicit permissions on that table to "user1" and "public".
I take a backup using pg_dump -Fc, and then restore on the second cluster
(where "user1" does not exist).
The restore process says it ignored the error for the missing user, but the
restored table now has no perms at all. Not even for user public.
Examining pg_restore sql output shows two separate grant commands, however
the problem persists even if I pipe pg_restore output into psql. Very
strange.

When a role does not exist on the restore cluster, I would like pg_restore
to restore all valid permissions and simply omit those permissions from the
missing role. Currently, no permissions are restored.

Source cluster version 9.6.9 (don't think this is the issue)
Destination cluster version 10.4

Thank you.
--

[image: photo]
*Moshe Jacobson*
Principal Architect, Nead Werx, Inc.

www.neadwerx.com
2323 Cumberland Pkwy SE #201, Atlanta GA 30339
<http://linkedin.com/in/jehsom> <http://facebook.com/NeadWerx/>
<http://goo.gl/maps/7SL9gn5fBi62>

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-07-12 22:07:42 Re: pg_restore: All GRANTs on table fail when any one role is missing
Previous Message Dan Book 2018-07-12 15:33:52 Re: BUG #15277: ts_headline strips things that look like HTML tags and it cannot be disabled