Skip site navigation (1) Skip section navigation (2)

Re: What am I doing wrong with this comma-delimited copy?

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: James Long <pgsql-novice(at)museum(dot)rain(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: What am I doing wrong with this comma-delimited copy?
Date: 2007-04-03 22:49:49
Message-ID: 4612DA0D.5020201@mail.nih.gov (view raw or flat)
Thread:
Lists: pgsql-novice
James Long wrote:
> 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 T1 TO 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.
>
>   
See here:

http://www.postgresql.org/docs/8.2/static/sql-copy.html

fieldsep does not affect the COPY command.


In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2007-04-04 00:18:00
Subject: Re: What am I doing wrong with this comma-delimited copy?
Previous:From: James LongDate: 2007-04-03 22:31:29
Subject: What am I doing wrong with this comma-delimited copy?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group