only seeing first of many COPY commands in input file

Поиск
Список
Период
Сортировка
От Rachel McConnell
Тема only seeing first of many COPY commands in input file
Дата
Msg-id 419D0FE5.8000308@enginegreen.com
обсуждение исходный текст
Ответы Re: only seeing first of many COPY commands in input file  (Terry Lee Tucker <terry@esc1.com>)
Список 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@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


В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick B Kelly
Дата:
Сообщение: Re: Can COPY skip columns?
Следующее
От: Chris Green
Дата:
Сообщение: Odd permission denied message when starting client