Dumping pg_shadow and pg_database as SQL using pg_dump

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Dumping pg_shadow and pg_database as SQL using pg_dump
Date: 2004-09-07 13:47:56
Message-ID: 413DBC0C.5050800@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to save the list of users, groups, and databases regularly to a
separate file (just in case). The output of pg_dumpall suffices for my need:

=================================
DELETE FROM pg_shadow WHERE usesysid <> (SELECT datdba FROM pg_database
WHERE datname = 'template0');
CREATE USER ... WITH SYSID ... PASSWORD '...' NOCREATEDB NOCREATEUSER;
...

DELETE FROM pg_group;
...

CREATE DATABASE ... WITH OWNER = ... TEMPLATE = ... ENCODING = '...';
...
=================================

But can I get these with pg_dump?

--
dave

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-09-07 13:59:03 Re: error: insert has more expressions than target column
Previous Message Tom Lane 2004-09-07 13:47:47 Re: The usual sequential scan, but with LIMIT !