Re: Backup single database roles and ACLs

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Rui Lopes <rgl(at)ruilopes(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Backup single database roles and ACLs
Date: 2007-10-03 18:00:29
Message-ID: 4703D8BD.6040108@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rui Lopes wrote:
> Hello,
>
> How do I backup all the roles and ACLs that have permissions to a single
> database?
>
> pg_dumpall -g does not do the trick because it dumps all the roles from
> all the databases.

roles are part of the catalog/cluster not a database, thus -g is your
option.

It has been discussed in the past to have per database roles, but that
has not beed coded.

Joshua D. Drake

>
> I've read the system catalogs documentation [1], but I didn't figure how
> to relate the database name with the table names...
>
> So far I can get all the database names, owners oid and ACLs using:
>
> select oid,datname,datdba,datacl from pg_database;
>
> But how do I relate pg_database.oid with pg_class (to get table ACLs)?
> or maybe its related with other table that I'm missing?
>
>
> TIA!
>
> Best regards,
> Rui Lopes
>
> [1] http://www.postgresql.org/docs/8.2/static/catalogs.html

- ---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

- --

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHA9i9ATb/zqfZUUQRAqorAKCslzpZqeAyj79nYY5amFFWTuJ7dwCgkowS
8vza+ntivUnancUTZa6eaJQ=
=MUB8
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brian Wipf 2007-10-03 18:16:23 Re: PITR Recovery and out-of-sync indexes
Previous Message Jeff Lanzarotta 2007-10-03 17:58:08 Importing MySQL dump into PostgreSQL 8.2