Re: copy syntax

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: copy syntax
Date: 2012-04-04 21:46:38
Message-ID: 4F7CC13E.20800@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • copy syntax at 2012-04-04 20:01:19 from Andy Chambers

Browse pgsql-general by date

  From Date Subject
Next Message Scott Chapman 2012-04-04 22:41:25 EnterpriseDB install of Postgres on Ubuntu 10.04 library path issues - no version information available (required by /lib/libblkid.so.1)
Previous Message Jon Nelson 2012-04-04 20:58:30 Re: views, queries, and locks