Re: Dumping part (not all) of the data in a database...methods? - Mailing list pgsql-general

From Leif B. Kristensen
Subject Re: Dumping part (not all) of the data in a database...methods?
Date
Msg-id 200704112112.57320.leif@solumslekt.org
Whole thread Raw
In response to Dumping part (not all) of the data in a database...methods?  (Andrew Edson <cheighlund@yahoo.com>)
List pgsql-general
On Wednesday 11. April 2007 19:50, Andrew Edson wrote:
>I'm needing to do a partial dump on a database.  All of the entries in
> the db can be marked as one of two groups, and I've been asked to
> create a dump of just the second group.  It is possible to do a
> select statement based dump and just grab the one set of records in
> the output?

I had a similar problem with my genealogy database, of which I'm making
regular exports to the Web. In order to not publish data on living
people, I've got a boolean flag is_public. For me, the easiest way to
export a "washed" subset of the data, was writing a custom Python
script. It also enabled me to transform the data in other ways, as the
script is reading from special views and makes a "flattened" image of
the database, more suitable for Web -- or at least for the Swedish
dolphin stuff which I'm still using on my Website :-)

As I'm no Python guru, the code is rather simplistic. But it does its
job well enough for me. If you want a copy of the script, just drop me
a mail.
--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE
My Jazz Jukebox: http://www.last.fm/user/leifbk/

pgsql-general by date:

Previous
From: "Nitin Verma"
Date:
Subject: ERROR: XLogFlush request 0/240169BC is not satisfied
Next
From: "Ardian Xharra"
Date:
Subject: Re: Kill session in PostgreSQL