Re: COPY problem on -- strings

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sabin Coanda <sabin(dot)coanda(at)deuromedia(dot)ro>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY problem on -- strings
Date: 2008-11-20 11:19:08
Message-ID: 492547AC.8070104@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sabin Coanda 2008-11-20 11:21:04 hidden errors calling a volatile function inside a stable function
Previous Message Craig Ringer 2008-11-20 11:12:38 Re: PostgreSQL 8.4 download?