Skip site navigation (1) Skip section navigation (2)

Re: Flat File unload/export/copy

From: "Obe, Regina" <robe(dot)dnd(at)cityofboston(dot)gov>
To: <steve(at)retsol(dot)co(dot)uk>,"PostGreSQL" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Flat File unload/export/copy
Date: 2008-09-12 15:31:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
And why can't you use copy?
Something like below -
COPY (SELECT * FROM sometable WHERE somevalue LIKE '%') TO




From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org] On Behalf Of Steve T
Sent: Friday, September 12, 2008 11:16 AM
To: PostGreSQL
Subject: [NOVICE] Flat File unload/export/copy

Is there a command that copies data from a table to a flat file for
specified selection criteria?
IE akin to a copy but not dumping a whole file?
If I'm about to do a major change to data in a table, I'd like to be
able to keep a copy of the data before the change (I know I can
Begin...rollback should things go wrong).

Is there a command that I've missed? (Informix had an 'UNLOAD TO blah
SELECT blah..' type command which presumably was proprietary). 
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.

In response to


pgsql-novice by date

Next:From: Steve TDate: 2008-09-12 16:10:17
Subject: Re: Flat File unload/export/copy
Previous:From: Steve TDate: 2008-09-12 15:16:13
Subject: Flat File unload/export/copy

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group