Skip site navigation (1) Skip section navigation (2)

Re: Truncate on pg_dump / pg_restore

From: "chris smith" <dmagick(at)gmail(dot)com>
To: "Bryce Nesbitt" <bryce2(at)obviously(dot)com>
Cc: "sql pgsql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Truncate on pg_dump / pg_restore
Date: 2008-10-25 10:18:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Sat, Oct 25, 2008 at 5:32 PM, Bryce Nesbitt <bryce2(at)obviously(dot)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

In response to


pgsql-sql by date

Next:From: Bryce NesbittDate: 2008-10-25 15:23:46
Subject: Re: Truncate on pg_dump / pg_restore
Previous:From: Bryce NesbittDate: 2008-10-25 06:32:03
Subject: Truncate on pg_dump / pg_restore

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group