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 General > better error ha...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15351 of 17602
Post > Topic >>

better error handling for COPY from stdin

by depesz@[EMAIL PROTECTED] (hubert depesz lubaczewski) Apr 22, 2008 at 04:02 PM

if you have .sql file with COPY table FROM stdin;
and the table doesn't exist, psql prints a lot of errors from lines
which contain only data for copy.

to reproduce:
=> echo -ne "COPY non_existing_table FROM stdin;\n1\n\\N\n2\n\\.\n" | psql
ERROR:  relation "non_existing_table" does not exist
invalid command \N
invalid command \.
ERROR:  syntax error at or near "1"
LINE 1: 1
        ^

would it be possible to make it smarter, so it will not treat datalines
from
failed copy as statements?

i see a lot of questions that "postgresql says command \N is invalid" -
which
is of course rubbish, but making psql a bit smarter would make all of
these
question go away.

regards,

depesz

-- 
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/
- blog dla ciebie (i moje CV)

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




 1 Posts in Topic:
better error handling for COPY from stdin
depesz@[EMAIL PROTECTED]   2008-04-22 16:02:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Mon Dec 1 18:47:34 CST 2008.