Re: pg_dump --exclude-table-data

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump --exclude-table-data
Date: 2011-11-04 14:21:43
Message-ID: CA+TgmoZFQEwrVQ+HzUeg8-4x=w12CghFGNQzW9MAZqO6aw9hYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 2, 2011 at 6:02 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> On 09/02/2011 03:15 PM, Josh Berkus wrote:
>>>
>>> OK, this seems to have some pluses and no negative comments, so it seems
>>> worth going forward. Do we want an equivalent pg_restore option?
>>
>> I'm not sure it's *as* important for pg_restore, since I can easily use
>>  a manifest to avoid restoring data for a single table.  So I guess it's
>> a question of "how hard is it to add it?"
>>
>
> The short answer is "more work than I want to put in to this." pg_restore
> doesn't have any of pg_dump's infrastructure for handling table name
> patterns, nor for excluding tables. So I think all that would remain a TODO.
> (A good beginner project, maybe).
>
> A slightly updated patch is attached, the main change being that I removed
> use of a short option and only support the long name option. "-D" didn't
> seem sufficiently mnemonic to me. I'll add this to the November commitfest,
> but I'd like to get it committed ASAP as it will simplify setting up the
> -pre and -post data patches.

Instead of:

do NOT dump data for the named table(s)

How about:

dump only schema for the named table(s)

I'm also a bit concerned about the relationship between this and the
existing -s option. It seems odd that you use --schema-only to get
the behavior database-wide, and --exclude-table-data to get it for
just one table. Is there some way we can make that a bit more
consistent?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-11-04 14:23:04 Re: Show statistics target in \d+
Previous Message Tom Lane 2011-11-04 14:19:45 Re: Show sequences owned by