pg_dump and copy command

Lists: pgsql-general
From: "Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump and copy command
Date: 2006-04-05 07:37:28
Message-ID: b0a3bf780604050037w6bdb3c82y42a7f2160127d613@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

I've dumped a 7.4.5 database using pg_dump and when I used the result
via pgAdmin v1.4.2 on a remote 7.4.11 server, I get an error:-

ERROR: syntax error at or near "45183" at character 5848

and the offending code is:-

COPY jobs (job_id, client_id, title, start_date, final_date,
approver1_id, approver2_id) FROM stdin;
45183 1634 Cataloguer 2001-04-18 2001-05-08 \N \N
45800 1634 Local Studies Librarian 2002-02-18 2002-11-12 \N \N
\.

Why is pg_dump generating offending code?

Are there any special options that I must use with pg_dump to make
this code executeable?

Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and copy command
Date: 2006-04-05 14:03:06
Message-ID: 27451.1144245786@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com> writes:
> I've dumped a 7.4.5 database using pg_dump and when I used the result
> via pgAdmin v1.4.2 on a remote 7.4.11 server, I get an error:-

> ERROR: syntax error at or near "45183" at character 5848

Does pgAdmin promise that it can read pg_dump scripts? They're intended
to be fed into psql. The symptom sounds like pgAdmin is getting
confused about where the command boundaries are, which is fairly easy to
do in a mixed SQL-and-COPY-data script.

regards, tom lane