Re: [SQL] import CSV file

2007-03-14 Thread Andrew Sullivan
On Tue, Mar 13, 2007 at 11:52:17PM +, T E Schmitz wrote: > Also, it's nopt happy about the date format : 2007/02/09 You may need to fiddle with your date style. It works for me on 8.1: SELECT '2007/02/09'::date; date 2007-02-09 (1 row) A -- Andrew Sullivan | [EMAIL

Re: [SQL] import CSV file

2007-03-14 Thread T E Schmitz
T E Schmitz wrote: Rodrigo De León wrote: On 3/13/07, T E Schmitz <[EMAIL PROTECTED]> 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

Re: [SQL] import CSV file

2007-03-14 Thread T E Schmitz
Rodrigo De León wrote: On 3/13/07, T E Schmitz <[EMAIL PROTECTED]> 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 lin

Re: [SQL] import CSV file

2007-03-13 Thread Rodrigo De León
On 3/13/07, T E Schmitz <[EMAIL PROTECTED]> 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 Also, it's nopt happy about the date format : 2

Re: [SQL] import CSV file

2007-03-13 Thread T E Schmitz
D'Arcy J.M. Cain wrote: On Tue, 13 Mar 2007 20:38:33 + T E Schmitz <[EMAIL PROTECTED]> wrote: psql -h lolek -U tes -d stockmarket -c "copy history from STDIN CSV" < /tmp/FTSE.csv Also, it's nopt happy about the date format : 2007/02/09 -- Regards, Tarlika Elisabeth Schmitz -

Re: [SQL] import CSV file

2007-03-13 Thread T E Schmitz
Jure Kodzoman wrote: On Tue, 2007-03-13 at 20:38 +, T E Schmitz wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c "copy history from '/tmp/FTSE.csv' CSV"; ERROR: could not open file "/tmp/FTSE.csv" for reading: No such file or directory

Re: [SQL] import CSV file

2007-03-13 Thread T E Schmitz
D'Arcy J.M. Cain wrote: On Tue, 13 Mar 2007 20:38:33 + T E Schmitz <[EMAIL PROTECTED]> wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c "copy history from '/tmp/FTSE.csv' CSV"; ERROR: could not open file "/tmp/FTSE.csv" for reading: No

Re: [SQL] import CSV file

2007-03-13 Thread Jure Kodzoman
On Tue, 2007-03-13 at 20:38 +, T E Schmitz wrote: > I am trying to batch-load a tab-separated CSV file: > > psql -h lolek -U tes -d stockmarket -c "copy history from > '/tmp/FTSE.csv' CSV"; > > ERROR: could not open file "/tmp/FTSE.csv" for reading: No such file or > directory > > The fi

Re: [SQL] import CSV file

2007-03-13 Thread D'Arcy J.M. Cain
On Tue, 13 Mar 2007 20:38:33 + T E Schmitz <[EMAIL PROTECTED]> wrote: > I am trying to batch-load a tab-separated CSV file: > > psql -h lolek -U tes -d stockmarket -c "copy history from > '/tmp/FTSE.csv' CSV"; > > ERROR: could not open file "/tmp/FTSE.csv" for reading: No such file or > d

Re: [SQL] import CSV file

2007-03-13 Thread Alvaro Herrera
T E Schmitz wrote: > I am trying to batch-load a tab-separated CSV file: > > psql -h lolek -U tes -d stockmarket -c "copy history from > '/tmp/FTSE.csv' CSV"; > > ERROR: could not open file "/tmp/FTSE.csv" for reading: No such file or > directory > > The file exists. Do I need to escape the

[SQL] import CSV file

2007-03-13 Thread T E Schmitz
I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c "copy history from '/tmp/FTSE.csv' CSV"; ERROR: could not open file "/tmp/FTSE.csv" for reading: No such file or directory The file exists. Do I need to escape the quotes? set-up: Postgres 8.1, De