PostgreSQL 8.4 - dumping database connection privileges

From: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
To: PostgreSQL-Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: PostgreSQL 8.4 - dumping database connection privileges
Date: 2010-05-01 09:31:51
Message-ID: 4BDBF507.5030006@pws.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

I've recently upgraded to PostgreSQL 8.4 as Redhat had begun supporting
it. I have tried to dump database grants, but have only found an
obscure way to do it.

I would expect;

postgres$ pg_dump -Fc database_name > backup.pgdump

would include all of the GRANT CONNECT on database_name TO "Role";
commands. It does not.

Second I tried;

postgres$ pg_dumpall -g > globals.sql

This also did not produce any GRANT CONNECT statements.

The only method I found that works is;

postgres$ pg_dumpall -s | grep 'ON DATABASE'

This method is not exactly fool proof and isn't what I expected to have
to do.

Is this considered a bug that the only way to do a dump/restore with
database privileges is to use pg_dumpall? I expect that pg_dump of a
database would include all of that information. I would argue it is at
least a misfeature and difficult for even an experienced user to understand.

Regards

Russell

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2010-05-01 11:34:50 Re: BUG #5444: Database Backup Restore - Out of memory problem
Previous Message Martin Pitt 2010-05-01 08:45:10 Re: [9.0beta5/cvs head] build failure due to unchecked results