Re: Adding WHERE clause to pg_dump - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: Adding WHERE clause to pg_dump
Date
Msg-id 1217021372.16378.118.camel@jd-laptop
Whole thread Raw
In response to Re: Adding WHERE clause to pg_dump  (daveg <daveg@sonic.net>)
Responses Re: Adding WHERE clause to pg_dump  (Simon Riggs <simon@2ndquadrant.com>)
List 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





pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [PATCHES] odd output in restore mode
Next
From: Simon Riggs
Date:
Subject: Re: Adding WHERE clause to pg_dump