pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Rogers <progers@sparkbase.com>
To: pgsql-admin@postgresql.org
Subject: Pg-restore Only Privileges/ACL?
Date: Mon, 12 Dec 2011 14:40:05 -0500
Message-ID: <4EE65895.5080308@sparkbase.com> (raw)

-----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.




Message-ID: <4EE65895.5080308@sparkbase.com>
Permalink:  ../4EE65895.5080308@sparkbase.com/
Also on:    postgresql.org/message-id/4EE65895.5080308@sparkbase.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: progers@sparkbase.com
  Subject: Re: Pg-restore Only Privileges/ACL?
  In-Reply-To: <4EE65895.5080308@sparkbase.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox