postgres error reporting

From: chisel(at)herlpacker(dot)co(dot)uk (Chisel Wright)
To: pgsql-general(at)postgresql(dot)org
Subject: postgres error reporting
Date: 2003-02-17 11:34:13
Message-ID: 2eeea331.0302170334.7c1acadf@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

I like postgres, I find I get on much better with it than mysql.
I have one really big problem with it though.

Why is the error reporting so bad/vague for failed inserts?

I have a perl script that's doing an insert query with 45-50 fields.
There seems to be some bad data in the file I'm importing from.

The message from postgres:

DBD::Pg::db do failed: ERROR: pg_atoi: zero-length string at
/path/to/Module.pm line 348, <STDIN> line 1.

Which field doesn't it like?! Why can't it say something like:

DBD::Pg::db do failed: ERROR: pg_atoi: zero-length string in field
SomeTableField ....

Is there something I'm missing that will give me this information?

It's nothing to do with the perl either. Pasting the query into psql
gives:

ERROR: pg_atoi: zero-length string

No clues as to which field or piece of data it is complaining about.

Does anyone know how to find this out?

Chisel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roberto de Amorim 2003-02-17 14:10:20 BLOB or BYTEA field
Previous Message Andrei Ivanov 2003-02-17 10:46:20 Re: Index not used with IS NULL

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-02-17 20:42:08 Re: improve docs on min()/max() performance
Previous Message Christopher Kings-Lynne 2003-02-17 05:26:23 Non-colliding auto generated names