Bug with SQL-COPY in 7.2

Started by Detlef Plotzkyabout 24 years ago1 messagesbugs
Jump to latest

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

Attachments:

ascii.zipapplication/x-zip-compressed; name=ascii.zipDownload