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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to