From: | Laurent ROCHE <laurent_roche(at)yahoo(dot)com> |
---|---|
To: | Andrew Edson <cheighlund(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re : Dumping part (not all) of the data in a database...methods? |
Date: | 2007-04-12 09:11:11 |
Message-ID: | 929146.56600.qm@web34404.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
AFAIK, you can not do that with pg_dump ... but as you are working on only one table you can write the COPY command your self, and since version 8.2, you can write a SELECT query instead of a table name, like
COPY (SELECT * FROM country WHERE country_name LIKE 'A%') TO '/usr1/proj/bray/sql/a_list_countries.copy';
see http://www.postgresql.org/docs/8.2/interactive/sql-copy.html for all the details
I hope this helps,
L(at)u
The Computing Froggy
----- Message d'origine ----
De : Andrew Edson <cheighlund(at)yahoo(dot)com>
À : pgsql-general(at)postgresql(dot)org
Envoyé le : Mercredi, 11 Avril 2007, 20h43mn 39s
Objet : Re: [GENERAL] Dumping part (not all) of the data in a database...methods?
I am aware of this, yes, but the data in question is all (both sets) contained on a single table. That's why I was looking for a way to do a 'dump where (select foo where bar = 'criteria')' structure.
Merlin Moncure <mmoncure(at)gmail(dot)com> wrote: On 4/11/07, 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?
you are aware you can dump a table at a time, right? pg_dump -t foo
dumps table foo. A partial dumping scheme would probably involve
using pg_dump with various flag in combination with a script that
makes a list of things to
dump.
merlin
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Mura | 2007-04-12 09:54:50 | Oracle mailing lists |
Previous Message | Avdhoot Kishore Saple | 2007-04-12 08:46:57 | local selectivity estimation - computing frequency of predicates |