Dump a database excluding one table DATA?

From: Dmitry Koterov <dmitry(at)koterov(dot)ru>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Dump a database excluding one table DATA?
Date: 2011-08-18 19:49:45
Message-ID: CA+CZih4cWaYN8=7-Mifp1jidrWMT+t3KHFT-X6dft7Kb1nf5Tg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

Is there any way (or hack) to dump the whole database, but to exclude the
DATA from a table within this dump? (DDL of the table should not be
excluded: after restoring the data the excluded table should look "empty".)

I see -T switch of pg_dump, but seems -T excludes the data AND the DDL of a
table (and possibly all objects which depend on this table?), so after
restoration the database structure becomes broken sometimes.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Cheng 2011-08-18 19:54:51 Re: call initdb as regular user
Previous Message Dmitriy Igrishin 2011-08-18 19:02:53 Re: Using Postgresql as application server