From: | Rachel McConnell <rachel(at)enginegreen(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | only seeing first of many COPY commands in input file |
Date: | 2004-11-18 21:11:01 |
Message-ID: | 419D0FE5.8000308@enginegreen.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
I am trying to import data using COPY, from a file containing thirty or
so COPY commands each with 0 or more rows of data. Reason, I have a
small data set I want to include into a database with an identical
schema, with existing data. I figured a good way to do this would be to
use pg_dump on the small dataset, trim out the table definitions and
constraints, and run the resulting file. (I also reordered the COPY
statements to allow for FK constraints.)
$ psql -U username -f filename rachel_philly
The result I'm getting is that the first COPY statement is executed, and
none of the rest of them. No error messages appear. I've run through
several of the rest of the statements by commenting out the statement
that ran and running the file again, and in each case the data from the
first COPY statement is added to the database, but no data from any of
the rest of the COPY statements is imported.
When I restore normally from an untrimmed pg_dump file, all the COPY
statements are run without difficulty. I have read over the beginning
and end of the file but don't see anything that looks like a START ..
COMMIT block, or any similar thing that would flag for "run all of these
commands" vs. "only run the first command and then stop".
rachel=> select version();
version
------------------------------------------------------------------------------------------
PostgreSQL 7.4.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3
(Debian 20040401)
(1 row)
rachel_philly=> \q
rachel(at)qbert /cygdrive/d/test
$ psql --version
psql (PostgreSQL) 7.4.2
contains support for command-line editing
I wouldn't think the version mismatch is causing this, since the full
restore works fine...
Any ideas on what I may be doing wrong, or further avenues of research
would be much appreciated!
Rachel
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Green | 2004-11-18 21:27:08 | Odd permission denied message when starting client |
Previous Message | Patrick B Kelly | 2004-11-18 21:08:04 | Re: Can COPY skip columns? |