Search Postgresql Archives

only seeing first of many COPY commands in input file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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


---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux