System dump, but not in the default format

Started by David Goodenoughabout 23 years ago3 messagesgeneral
Jump to latest
#1David Goodenough
david.goodenough@btconnect.com

I would like to do a dump of all the DBs in a postgres system in the manner
of pg_dumpall, but dumping the DBs out to individual files rather than one
big one, and using a binary dump to make individual table restores easier.

Can I do this with options to pg_dumpall (or some other command I have not
noticed), or do I need to take a copy and modify the copy to do what I need?

I am running a 7.2 system if that makes a difference.

Thanks in advance

David

#2Dave Smith
dave.smith@candata.com
In reply to: David Goodenough (#1)
Re: System dump, but not in the default format

I would suggest using pg_dumpall only to dump the global postgres info
and then use pg_dump with the -Fc option for the databases .From that
you can use pg_restore for individual tables.

Show quoted text

On Fri, 2003-03-28 at 08:24, David Goodenough wrote:

I would like to do a dump of all the DBs in a postgres system in the manner
of pg_dumpall, but dumping the DBs out to individual files rather than one
big one, and using a binary dump to make individual table restores easier.

Can I do this with options to pg_dumpall (or some other command I have not
noticed), or do I need to take a copy and modify the copy to do what I need?

I am running a 7.2 system if that makes a difference.

Thanks in advance

David

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

#3Peter Eisentraut
peter_e@gmx.net
In reply to: David Goodenough (#1)
Re: System dump, but not in the default format

David Goodenough writes:

I would like to do a dump of all the DBs in a postgres system in the manner
of pg_dumpall, but dumping the DBs out to individual files rather than one
big one, and using a binary dump to make individual table restores easier.

for d in $(psql -At -c 'select datname from pg_database'); do pg_dump $d >$d.sql; done

--
Peter Eisentraut peter_e@gmx.net