[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] import CSV file
From:       T E Schmitz <mailreg () numerixtechnology ! de>
Date:       2007-03-14 15:09:09
Message-ID: 45F81015.20101 () numerixtechnology ! de
[Download RAW message or body]

T E Schmitz wrote:
> Rodrigo De León wrote:
> 
>> On 3/13/07, T E Schmitz <mailreg@numerixtechnology.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 

"copy history from STDIN DELIMITER AS '\t' CSV"
is the answer

>>> Also, it's nopt happy about the date format : 2007/02/09

The correct delimiter solved my date problem, too.

-- 


Regards,

Tarlika Elisabeth Schmitz

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic