Home > Archive > PostgreSQL Discussion > April 2006 > pg_dump and copy command









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author pg_dump and copy command
Chris Velevitch

2006-04-05, 3:27 am

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 Catalogue
r 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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Tom Lane

2006-04-05, 9:30 am

"Chris Velevitch" <chris.velevitch@gmail.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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Dave Page

2006-04-05, 11:31 am



> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tom Lane
> Sent: 05 April 2006 15:03
> To: Chris Velevitch
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] pg_dump and copy command
>
> "Chris Velevitch" <chris.velevitch@gmail.com> writes:
> the result
>
>
> 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.


pgAdmin PQexec's its input, therefore cannot handle the copy from stdin
in a pg_dump script. It should work if you use INSERTs instead of COPY
though.

Regards, Dave.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com