Re: Truncate on pg_dump / pg_restore - Mailing list pgsql-sql

From chris smith
Subject Re: Truncate on pg_dump / pg_restore
Date
Msg-id 3c1395330810250318r6f4c7e1ao9eac8dd35eed2726@mail.gmail.com
Whole thread Raw
In response to Truncate on pg_dump / pg_restore  (Bryce Nesbitt <bryce2@obviously.com>)
Responses Re: Truncate on pg_dump / pg_restore  (Bryce Nesbitt <bryce2@obviously.com>)
List pgsql-sql
On Sat, Oct 25, 2008 at 5:32 PM, Bryce Nesbitt <bryce2@obviously.com> 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 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 says use '-s' or '--schema-only'.

-- 
Postgresql & php tutorials
http://www.designmagick.com/


pgsql-sql by date:

Previous
From: Bryce Nesbitt
Date:
Subject: Truncate on pg_dump / pg_restore
Next
From: Bryce Nesbitt
Date:
Subject: Re: Truncate on pg_dump / pg_restore