What am I doing wrong with this comma-delimited copy? - Mailing list pgsql-novice

From James Long
Subject What am I doing wrong with this comma-delimited copy?
Date
Msg-id 20070403223129.GA83958@ns.umpquanet.com
Whole thread Raw
Responses Re: What am I doing wrong with this comma-delimited copy?  (Sean Davis <sdavis2@mail.nih.gov>)
Re: What am I doing wrong with this comma-delimited copy?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Welcome to psql 8.1.8, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

james=> \pset fieldsep ,
Field separator is ",".
james=> \copy transactions from bar
\.
ERROR:  value too long for type character(14)
CONTEXT:  COPY transactions, line 1, column symbol: "Cash,0,0,Cash Adjustment,4/2/2007,,,0.87,0,0,         ,BALANCE-SWP
T1TO T2,16,,Financial" 


psql appears to be treating the entire input line as one tuple,
instead of seeing the fieldsep value as a field delimiter.

Also, one issue I can see coming is the date format.  Is there
a way I can read M-D-Y (or M/D/Y) format dates and store them?
My default postgresql date format is Y-M-D.  I'd be happy to
retain Y-M-D on display, I just don't want to have to involve
a script to massage the input dates to Y-M-D format.


Thank you!


Jim

pgsql-novice by date:

Previous
From: Ramon Orticio
Date:
Subject: Re: PL/pgSQL how to install
Next
From: Sean Davis
Date:
Subject: Re: What am I doing wrong with this comma-delimited copy?