Re: pg_dump in cycle

From: Lars Haugseth <lars(at)tinde(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump in cycle
Date: 2004-09-17 12:00:55
Message-ID: 200409171400.55590.lars@tinde.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lars Haugseth 2004-09-17 13:38:00 Re: psql + autocommit
Previous Message Agarwal Deepesh-A19519 2004-09-17 11:52:08 Support on Enterprise Linux (newbie)