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

Feature: give pg_dump a WHERE clause expression

From: Davy Durham <pubaddr5(at)davyandbeth(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Feature: give pg_dump a WHERE clause expression
Date: 2008-06-01 05:56:53
Message-ID: 1212299813.17810.17.camel@ubuntu (view raw or flat)
Thread:
Lists: pgsql-patches
Greetings, 
  I have developed a fairly simple patch to the pg_dump utility.  It is
against version 8.3.1 source code.

  I have added a new parameter, -w/--where=EXPR 

  This lets you specify an expression that will be used in a WHERE
clause when the data is dumped.

  I have implemented and tested that it works when generating either
COPY statements (the default), or INSERT statements (-d and -D).  These
two modes of operation have two different sections of code that select
the data to be dumped.

  Though this change could arguably be removed, when a -w/--where
expression is specified, it is also indicated in the comments of the
dump output so one viewing the dump can see that it was not necessarily
all of the data.  

  When -w/--where is not specified, the dump output is just as if this
patch had not been applied.

  I've also updated the pg_dump.sgml file to add a description of this
new flag.

  The code changes should also conform to the existing code style within
pg_dump.  

  The patch should be applied from the root of the source tree with a
-p1 option to the patch command.


Please give any feedback if the patch needs improvement

Thanks for a great DB!

  

Attachment: pg_dump-where-expr.patch
Description: text/x-patch (10.7 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2008-06-01 14:43:18
Subject: Re: Feature: give pg_dump a WHERE clause expression
Previous:From: Jeff DavisDate: 2008-06-01 03:38:34
Subject: Re: synchronized scan: reset state at end of scan

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