Moshe Jacobson <moshe@neadwerx.com> writes: > 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?
Hi Tom,
Yes, I'm sure. Here is a reproduction of the problem exclusively on 10.4. An important note is that if there are valid permissions on the table before the invalid one, I think those will be restored successfully. Only those after the invalid permission are not restored.
(0)(0j)[jehsom@athena ~]$ psql -c '\dp' mzj_test
Access privileges
Schema | Name | Type | Access privileges | Column privileges | Policies