Bug with SQL-COPY in 7.2 - Mailing list pgsql-bugs

From Detlef Plotzky
Subject Bug with SQL-COPY in 7.2
Date
Msg-id 200202151407.g1FE7Gv24878@apollo.bvu.de
Whole thread Raw
List pgsql-bugs
Hi,
trying to import an ascii file with the sql copy statement
fails in the pg_atoi routine
   if the last field is "int"
 and
   if the ascii file has DOS line endings (cr=0x0d and lf=0x0a).

The main problem is the error message: you cannot detect
the cr on the screen, you see only a "unknown" error.

Example of sql session:


shell> psql testdb postgres

testdb=# \d telefon
               Table "telefon"
 Column |          Type          | Modifiers
--------+------------------------+-----------
 name   | character varying(255) |
 nr     | character varying(63)  |
 email  | character varying(63)  |
 dummy  | integer                |

testdb=# copy telefon from '/tmp/tel.asc' delimiters '|' ;
": can't parse "ne 1, pg_atoi: error in "12345
testdb=#\q

The data file tel.asc of the example is packed in the zip file
in the attachment.

Kind regards
Detlef


Attachment

pgsql-bugs by date:

Previous
From: David Goodenough
Date:
Subject: (JDBC) KEY_SEQ in Foreign Key result set starts at 0, should be 1
Next
From: Chris Sutton
Date:
Subject: rename column and trigger on column