bug in COPY implementation (all versions of Postgres)?

From: Konstantin Izmailov <pgfizm(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: bug in COPY implementation (all versions of Postgres)?
Date: 2013-04-05 04:35:16
Message-ID: CAAw-MsfG1q4A9GCi45DLxTyxqaAB8oNV-n5ie=r7u59d=69aNw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I came across an issue that looks like a bug in COPY. There are many
similar posts, e.g.
http://stackoverflow.com/questions/13485030/strange-postgresql-value-too-long-for-type-character-varying500,
without a good unswer.

Simplified steps to reproduce the issue:
1. CREATE TABLE TEST (description varchar(10));
2. Insert value 'Galaxy\040Tab' using command COPY TEST(description) FROM
stdin WITH DELIMITER '|' CSV.

The following error is returned: value too long for type character
varying(10)

Of course real life scenarios are more complex and different characters
were used (\042 and \005).

Is this a bug, or an incorrect use of COPY/CSV?

Thank you
Konstantin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Lawrence Barwick 2013-04-05 05:35:21 Re: bug in COPY implementation (all versions of Postgres)?
Previous Message Adrian Klaver 2013-04-05 00:03:07 Re: Triggers on Foreign Tables