From: Naomi Walker <nwalker@eldocomp.com>
To: Bhuvan A <bhuvansql@myrealbox.com>
To: pgsql-admin@postgresql.org
Subject: Re: loading and unloading rows
Date: Fri, 01 Nov 2002 16:57:42 -0700
Message-ID: <4.2.2.20021101165030.01dcbc70@imap.eldocomp.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0211011439400.7526-100000@Bhuvan.bksys.co.in >
References: <4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com>
>
>It is possible. Delimiters can be used while restoring the data file.
>Null string specification can also be specified. See,
>test_db=> \h COPY
>for more details.
The problem with COPY, I think, is that I cannot use a WHERE
statement. I'd like to just unload certain rows from a table. If I wanted
the whole table, i'll do a pg_dump or copy.
>In addition you should also do some find and replace in the data file
>before restoring it to another database. They are,
>s/\s*|\s*//g
>s/^\s*//g
Yes, sed is a fine tool, but this seems like such a fundamental need, i'm
surprised there is not better method.
Again, i'd like a way to easily unload some selected rows (select * table
where foo=X) from a table, and save them, or load them in another cluster,
etc. Short of writing them to a temp table, then pg_dumping, or some
klunk-oid mething, I do not see a clean way.
Back to the maddening crowd. Anyone at least agreed this is needed? Could
we add "where" clauses to COPY? That would be perfect.
----------------------------------------------------------------------------
----------------------------------
Naomi Walker
Eldorado Computing, Inc
Chief Information Officer
nwalker@eldocomp.com
602-604-3100 x242
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: nwalker@eldocomp.com, bhuvansql@myrealbox.com
Subject: Re: loading and unloading rows
In-Reply-To: <4.2.2.20021101165030.01dcbc70@imap.eldocomp.com>
References: <4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com> <4.2.2.20021101165030.01dcbc70@imap.eldocomp.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox