Re: pg_dump in cycle - Mailing list pgsql-general

From Lars Haugseth
Subject Re: pg_dump in cycle
Date
Msg-id 200409171400.55590.lars@tinde.com
Whole thread Raw
In response to Re: pg_dump in cycle  ("Najib Abi Fadel" <nabifadel@usj.edu.lb>)
List pgsql-general
* Najib Abi Fadel:
| This seems to be more interesting for shell scripting:
|
|  psql -d DatabaseName -c 'select datname from pg_database where not
| datistemplate' ;
|
|      datname
| -----------------
|  fgm_eval
|  hotline
|  usj
|  dragon_devel
|  dragon_joujou
|  dragon_devel_v2
|  dragon_prod
|  fgm
| (8 rows)

$ psql -ltA | cut -d'|' -f1 | grep -v '^template' | xargs -i pg_dump -f {}.pg_dump {}
--
-- PostgreSQL database dump complete
--

--
-- PostgreSQL database dump complete
--

$ ls -l *.pg_dump
-rw-r--r--    1 postgres users         493 2004-09-17 14:00 foo.pg_dump
-rw-r--r--    1 postgres users        3326 2004-09-17 14:00 test.pg_dump

--
Lars Haugseth

pgsql-general by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: PSQLFS - PostgreSQL File System
Next
From: Lars Haugseth
Date:
Subject: Re: psql + autocommit