Bug in COPY from CSV?

From: "Rick Schumeyer" <rschumeyer(at)ieee(dot)org>
To: "'PgSql General'" <pgsql-general(at)postgresql(dot)org>
Subject: Bug in COPY from CSV?
Date: 2005-01-29 01:02:32
Message-ID: 005b01c5059e$3670a210$0200a8c0@dell8200
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think I've found a bug in PG 8.0 that occurs while copying from CSV files.

I checked the bugs list but didn't see anything similar.

This occurs when reading a CSV file where one of the 'text' fields has

a blank line. I included an example that shows the problem below.

I found that if I change the blank line to have one space, pg reads

it just fine.

If this is indeed a bug, if someone could let me know the best

way to address it, I would appreciate it.

--EXAMPLE

create table t (

id integer,

description text

);

copy t from stdin with null as '' csv quote as '"';

1,"Now is the time"

2,"for all good men

to come

to the

aid of their party"

3,"The quick brown fox"

\.

--END EXAMPLE

The above example produces this output:

CREATE TABLE

psql:test2.sql:8: ERROR: unterminated CSV quoted field

CONTEXT: COPY t, line 5: ""

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2005-01-29 01:05:20 Re: Mail list / web issues
Previous Message Mike Benoit 2005-01-29 00:46:43 Postgresql v8.0 debian packages.