pg_restore: All GRANTs on table fail when any one role is missing - Mailing list pgsql-bugs

From Moshe Jacobson
Subject pg_restore: All GRANTs on table fail when any one role is missing
Date
Msg-id CAJ4CxLn9EUTdqd3S9+n+HZxwNuE8vXOnAV+hOZv5M6WX7ovdeA@mail.gmail.com
Whole thread Raw
Responses Re: pg_restore: All GRANTs on table fail when any one role is missing
List 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.
--

photo
Moshe Jacobson
Principal Architect, Nead Werx, Inc.

www.neadwerx.com

2323 Cumberland Pkwy SE #201, Atlanta GA 30339

pgsql-bugs by date:

Previous
From: Dan Book
Date:
Subject: Re: BUG #15277: ts_headline strips things that look like HTML tagsand it cannot be disabled
Next
From: Tom Lane
Date:
Subject: Re: pg_restore: All GRANTs on table fail when any one role is missing