Re: copy syntax - Mailing list pgsql-general

From Andreas
Subject Re: copy syntax
Date
Msg-id 4F7CC13E.20800@gmx.net
Whole thread Raw
In response to copy syntax  (Andy Chambers <achambers@mcna.net>)
List pgsql-general
Am 04.04.2012 22:01, schrieb Andy Chambers:
> dcm_eob=>  copy ar_data from '/tmp/ar-data.csv' with header true;
> ERROR:  syntax error at or near "true"
> LINE 1: copy ar_data from '/tmp/ar-data.csv' with header true;
>
> I can't figure out what's wrong with the syntax above.  Is something missing?
>

copy  ar_data
from   $$/tmp/ar-data.csv$$
csv header delimiter ';'
;

... providet it's not a REAL csv as in "comma separated ..."
... $$ works better as ' at leas when you need to have backslashes in
the path.
... and you'll need to mind the encoding of the CSV if you use some
international signs


pgsql-general by date:

Previous
From: Jon Nelson
Date:
Subject: Re: views, queries, and locks
Next
From: "hans wulf"
Date:
Subject: Hot synchron backup doesn't start