Pg-restore Only Privileges/ACL?

From: Paul Rogers <progers(at)sparkbase(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Pg-restore Only Privileges/ACL?
Date: 2011-12-12 19:40:05
Message-ID: 4EE65895.5080308@sparkbase.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Is there a way to restore only the privileges/ACL of a relation or
whole database?

Often I've restored most of a database when some roles were missing.
Usually this produces valid data and DDL except for some missing Grant
statements. It's easy enough to extract Grants from plain SQL, but
with the Pgdump format it's not obvious to me.

Dropping and restoring the whole database seems like overkill. Ideally
I'd expect an option like "--privileges-only" or "--acl-only" that can
also be isolated to one table with "--table".

On a related note, why does "--schema-only" include Grant statements
when restoring the entire structure but not when restoring only
certain table(s)?
-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJO5liVAAoJENTiWtMHborMAHUIAJw3puTg5edKkIIAK99OPptw
PTkxMX1xSJlCzGxlLY+c7b0Ws6fVlbJ4eJluxynx8EiqhfQs16MyN+pyhHI1wZje
V+8qxta5xmPUv1Vxhgoeh/AUJZsOfUxMRk/uIKwA0kgBezZvl4gzqy23+GSKQ/Oz
qFqGZWP8f/4R2l6mhmq6hCVLtqjieWfVY6v+OIu4LxjGfw+0iEyhkaSXxzvIehzw
IshNOJ3+oFkUdKCCHtHxty/4w23cwXMPJsA2UgqAMWvw4N1N8EnuDKIg76j3KWr+
kIYkSHsDjqwgwbyRzLEinDi1kMWxYTLpV+yimRDc65I/Qh6C/L66W97TRBsJw2k=
=7LvW
-----END PGP SIGNATURE-----

Privileged/Confidential Information may be contained in this message.

If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by it.

Browse pgsql-admin by date

  From Date Subject
Next Message Selva manickaraja 2011-12-13 08:23:28 Creating Multiple Instance
Previous Message Tom Lane 2011-12-12 16:11:19 Re: Problems while restoring databases