Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: copy comman...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3057 of 3255
Post > Topic >>

Re: copy command in Windows XP

by tgl@[EMAIL PROTECTED] (Tom Lane) Apr 1, 2008 at 10:44 AM

"Mat Dodgson" <mat@[EMAIL PROTECTED]
> writes:
> Here's some example sql I'm sending to the server:

> COPY searchindustry (searchsessionid, industrycode) FROM stdin;
> 289    5110
> 289    5121
> 289    5122
> 289    5123
> 289    5124
> 289    5125
> 289    5126
> 289    5129
> \.

> The error I get in the postgres query log is "syntax error at or near
"289"
> at character 65". char 65 is the first line of the data.

How are you "sending" this exactly?  The error message suggests that
it's all being pushed at the server as one SQL string.  That won't work.
The correct implementation requires just sending the COPY command itself
to the server, waiting for it to switch into COPY mode, and then sending
the data (using a different protocol than SQL commands are sent with).

You didn't say, but I gather you're using pgAdmin.  I don't know whether
it has any sup****t for copy-from-stdin, but if it does I'm pretty sure
you'd have to provide the data separately from the command.  If you
can't find anything like that, you'll have to resort to putting the data
in a file and using copy-from-file instead.

			regards, tom lane

-- 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
 




 2 Posts in Topic:
copy command in Windows XP
mat@[EMAIL PROTECTED] (&  2008-04-01 23:15:19 
Re: copy command in Windows XP
tgl@[EMAIL PROTECTED] (T  2008-04-01 10:44:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 14:21:14 CDT 2008.