Re: [SQL] Truncate on pg_dump / pg_restore

2008-10-25 Thread Harold A. Giménez Ch.
You can, assuming you start off with a pg_dump in custom format (use -Fc). You can use pg_restore's -l option to drop out the list contents of the archive, and then comment out whatever you do not want restored: pg_dump -Fc ... > your_db.dump pg_restore -l your_db.dump > your_db.list # edit

Re: [SQL] Truncate on pg_dump / pg_restore

2008-10-25 Thread Bryce Nesbitt
chris smith wrote: On Sat, Oct 25, 2008 at 5:32 PM, Bryce Nesbitt <[EMAIL PROTECTED]> wrote: I've got tables with pretty disposable data... meaning I want to drop the data... but restore empty indexed tables at pg_restore time. Do a schema-only dump. pg_dump --help say

Re: [SQL] Truncate on pg_dump / pg_restore

2008-10-25 Thread chris smith
On Sat, Oct 25, 2008 at 5:32 PM, Bryce Nesbitt <[EMAIL PROTECTED]> wrote: > Dear Postgres Gurus; > > Is there a way to truncate a table, at pg_dump time? > > I'm aware of various ways to exclude a table from a dump (>= 8.2), or to > selectively pg_restore. What I'm seeking here is different. I've