Re: postgres error reporting

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Chisel Wright <chisel(at)herlpacker(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgres error reporting
Date: 2003-02-18 19:04:47
Message-ID: 200302181904.h1IJ4lt18848@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches


New in 7.3, you can specify an empty COPY column for an integer. It has
to be a zero or some other value.

---------------------------------------------------------------------------

Chisel Wright wrote:
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Schuchardt 2003-02-18 19:08:27 Re: BLOB or BYTEA field
Previous Message Emmanuel Charpentier 2003-02-18 18:59:54 Re: Aggregate definition : small oversight ?

Browse pgsql-patches by date

  From Date Subject
Next Message Mike Mascari 2003-02-18 19:13:01 Re: postgres error reporting
Previous Message Bruce Momjian 2003-02-18 18:54:10 Re: pg_avd