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
The code changes should also conform to the existing code style within
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!
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2008-06-01 14:43:18|
|Subject: Re: Feature: give pg_dump a WHERE clause expression |
|Previous:||From: Jeff Davis||Date: 2008-06-01 03:38:34|
|Subject: Re: synchronized scan: reset state at end of scan|