Dumping pg_shadow and pg_database as SQL using pg_dump - Mailing list pgsql-general

From David Garamond
Subject Dumping pg_shadow and pg_database as SQL using pg_dump
Date
Msg-id 413DBC0C.5050800@zara.6.isreserved.com
Whole thread Raw
List 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


pgsql-general by date:

Previous
From: David Garamond
Date:
Subject: Salt in encrypted password in pg_shadow
Next
From: Richard Huxton
Date:
Subject: Re: error: insert has more expressions than target column