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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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 Content-Type Size
pg_dump-where-expr.patch text/x-patch 10.7 KB

Responses

Browse pgsql-patches by date

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