pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Naomi Walker <nwalker@eldocomp.com>
To: pgsql-admin@postgresql.org
Subject: loading and unloading rows
Date: Thu, 31 Oct 2002 17:36:07 -0700
Message-ID: <4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com> (raw)
In-Reply-To: <2D92FEBFD3BE1346A6C397223A8DD3FC092061@THOR.goeci.com>


This might sound silly, but I am trying something basic, and having 
trouble.  What I want to do is unload selected rows from a table, and load 
them somewhere else.

pg_dump works great if you want the whole table.  I suppose I could from 
one table, dump into a temp, and then pg_dump it, but that seems silly.

I noticed in the pg_dump unloaded looking rows, with a:
          COPY "table" FROM stdin;
before the rows.

So, I ran psql, did a \o to capture the output,
did a select * from table where x=y
whacked the first row in the output file, and added the COPY statement.
then did a psql dbname <file-with-rows.sql

The first column loaded, but the rest of the columns did not.  I noticed 
there were | delimiters in my unloaded one, and none in a pg_dump file.

This seems way too klunky, so I must be going about it all wrong.  In 
Informix-land I would just do a unload then a load.  What is the postgresql 
equivalent?

Suggestions?

Thanks,
Naomi
---------------------------------------------------------------------------- 
----------------------------------
Naomi Walker
Eldorado Computing, Inc
Chief Information Officer
nwalker@eldocomp.com
602-604-3100 x242
                                    




view thread (9+ messages)  latest in thread

Message-ID: <4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com>
Permalink:  ../4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com/
Also on:    postgresql.org/message-id/4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com

 · 

reply

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
  Subject: Re: loading and unloading rows
  In-Reply-To: <4.2.2.20021031172442.01d1fdf0@imap.eldocomp.com>
  References: <2D92FEBFD3BE1346A6C397223A8DD3FC092061@THOR.goeci.com> <4.2.2.20021031172442.01d1fdf0@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