From: | Sherrylyn Branchaw <sbranchaw(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: pg_restore restores privileges differently from psql |
Date: | 2019-01-15 12:57:13 |
Message-ID: | CAB_myF7+i9Twpx_f5qek-9w=wcT8o+zafVdLARGX_qopJrj1qw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Yeah, this is a known issue --- the various GRANTs for a specific object
are stored in a single "TOC entry" in the archive, which pg_restore will
send to the server in a single PQexec call, causing them to be effectively
one transaction. The easiest way to deal with it is to not send
pg_restore's output directly to the target server, but feed it through
psql, something like
pg_restore ... | psql [connection parameters]
There's been some discussion of a real fix, but it seems messy.
pg_restore doesn't have a parser that would be adequate to separate
out multiple SQL commands in a TOC entry, and we'd rather not try
to give it one (mainly because of fear of cross-version compatibility
issues).
Okay, thank you. I thought that might be the case: undesirable behavior
where the costs outweigh the benefits of fixing. Given that, would it be
worth making it more obvious in the pg_restore documentation that
pg_restore and its psql output don't always give the same results in the
target database?
Best,
Sherrylyn
From | Date | Subject | |
---|---|---|---|
Next Message | Rich Shepard | 2019-01-15 15:39:08 | Refining query statement |
Previous Message | ROS Didier | 2019-01-15 12:36:33 | RE: repmgr and SSH |