Re: import CSV file

From: T E Schmitz <mailreg(at)numerixtechnology(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: import CSV file
Date: 2007-03-14 14:45:21
Message-ID: 45F80A81.3010900@numerixtechnology.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Rodrigo De León wrote:
> On 3/13/07, T E Schmitz <mailreg(at)numerixtechnology(dot)de> wrote:
>
>> This is pretty ingenious!
>> Just a few minor problems:
>> - how does COPY know which column is which?
>> - how do I specify DELIMITER as TAB?
>
>
> See:
> http://www.postgresql.org/docs/8.2/static/sql-copy.html

Thank you for the links. I had read of the manual entry for the COPY
command and I know that I need something like

psql -h lolek -U tes -d stockmarket -c "copy history from STDIN
DELIMITER AS TAB CSV" < /tmp/FTSE.csv

My problem is how to specify the tab character on the command line
seeing as the COPY command is already enclosed in quotes.
When creating CSV output I use -F $'\t' on Unix. However,
DELIMITER AS $'\t' doesn't work.

>> Also, it's nopt happy about the date format : 2007/02/09
>
> See:
> http://www.postgresql.org/docs/current/static/runtime-config-client.html#GUC-DATESTYLE

--

Regards,

Tarlika Elisabeth Schmitz

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message T E Schmitz 2007-03-14 15:09:09 Re: import CSV file
Previous Message Michael Fuhr 2007-03-14 14:09:34 Re: How to declare cursor if tablename is a variable?