pg_dump feature patch to allow selection of rows to dump via where

From: Seth Robertson <in-postgres(at)baka(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: pg_dump feature patch to allow selection of rows to dump via where
Date: 2005-09-10 02:31:40
Message-ID: 200509100231.j8A2VeEL020435@not.baka.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

In order to support some automation, I needed the ability to pull out
subsets of postgres tables in a format which could be loaded into
other postgres databases. Instead of writing a utility to replicate
the functionality in pg_dump, I created a new flag, --where, which
allows you to postpend where (or order or limit or whatever) sql
fragments at the end of the select done by pg_dump.

You must use the --insert option with this so that it will generate
inserts (which is done via select) instead of copy (which is done via
copy).

You almost certain will need to also use the --table option since most
likely the sql fragment will only be valid for one table instead of
all tables.

I find it very useful and hope you do to. This patch was created with
7.x postgresql, but if it doesn't apply cleanly against 8.x, I can
probably update it for you.

Attachment Content-Type Size
unknown_filename text/plain 3.8 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2005-09-11 21:21:40 docs: config chapter
Previous Message David Fetter 2005-09-09 21:58:26 Caveat for Domains