Re: Dumping part (not all) of the data in a database...methods?

From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Dumping part (not all) of the data in a database...methods?
Date: 2007-04-11 19:12:57
Message-ID: 200704112112.57320.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2007-04-11 19:40:07 SQL - finding next date
Previous Message John D. Burger 2007-04-11 19:08:26 Re: Dumping part (not all) of the data in a database...methods?