Re: COPY problem on -- strings

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: COPY problem on -- strings
Дата
Msg-id 492547AC.8070104@archonet.com
обсуждение исходный текст
Ответ на COPY problem on -- strings  ("Sabin Coanda" <sabin.coanda@deuromedia.ro>)
Список pgsql-general
Sabin Coanda wrote:
> Hi,
>
> I have "PostgreSQL 8.3.5, compiled by Visual C++ build 1400" on Windows OS.
>
> I try to use the COPY command to optimize the backup/restore performance,
> but I found a problem. I reproduce it below.

I can't reproduce it here on 8.3 on linux.

> I backup the database plain with the command:
>  pg_dump.exe -U postgres -F p -v -f "backup_plain.sql" "DemoDB"
>
> I create a new database, and I run the script. But it rise me the error:
>   ERROR:  syntax error at or near "1"
>   LINE 49: 1 -- any text
>
> I look for the error line and I saw how pg_dump created the script
> statement:
>   COPY "A" ("Col1", "Col2") FROM stdin;
>   1 -- any text
>   \.

That's what I see too, and it's fine here.

Try trimming the file down to just those lines, manually create the
database and table and see if you can run the copy then. If so, then
Tom's right and there's an error before the COPY. If not, then you've
got something odd in the file (bad line-ending, invalid high-bit
character or some such).

--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: PostgreSQL 8.4 download?
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: transaction_read_only effects on performance, actual meaning (was: How to reduce impact of a query)