Re: Adding WHERE clause to pg_dump

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: daveg <daveg(at)sonic(dot)net>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, pubaddr5(at)davyandbeth(dot)com
Subject: Re: Adding WHERE clause to pg_dump
Date: 2008-07-25 21:29:32
Message-ID: 1217021372.16378.118.camel@jd-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2008-07-25 at 14:11 -0700, daveg wrote:
> On Fri, Jul 25, 2008 at 08:26:35PM +0100, Simon Riggs wrote:

> - This can be done with a script.
>
> Not really. The script would pretty much have to contain most of
> pg_dump. That's more than a script.
>

Yes really. :) The only thing pg_dump is buying you here is easy of
schema pull. In a situation like this you would pull a pg_dump -s then
only restore data that you want based on a single transaction snapshot
of the objects you are going to query.

> - users could make partial dumps and be confused and lose data.
>
> Yes, but they can already do that with -n, -t, and the new pre-data
> and post-data switches. This is one more case where the default is
> a full dump but you one can specificly request less.

No they actually can't. You are guaranteed that regardless of a -n or -t
flag that the data you receive is consistent. You can't guarantee that
with -w because you could pull different data based on an arbitrary
conditional that can not apply to all objects.

Joshua D. Drake

--
The PostgreSQL Company since 1997: http://www.commandprompt.com/
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-07-25 21:46:04 Re: Adding WHERE clause to pg_dump
Previous Message Simon Riggs 2008-07-25 21:25:01 Re: [PATCHES] odd output in restore mode