Moshe Jacobson <moshe@neadwerx.com> writes:
> 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.
Hm. I can understand why this would happen if you do pg_restore direct to
the server: the GRANTs will all be part of the same "TOC entry" in the
dump file, and I'm pretty sure pg_restore issues the entire contents of
a TOC entry in one PQexec, so that it's effectively a single transaction.
However, if you tell pg_restore to emit text and then pass the text to
psql, each SQL command should be processed separately. Are you sure about
the failure still occurring in that case?
regards, tom lane