Thread:

From
Date:
I upgraded to 7.3.3 from 7.2 something.  I guess the insert statment no longer
accepts a zero lenght string like ''
ERROR:  pg_atoi: zero-length string

Is there a way to make this work so it will put Null in the place of it?



Re:

From
Bruno Wolff III
Date:
On Wed, Aug 20, 2003 at 20:59:43 -0000,
  zoop@lone.ath.cx wrote:
> I upgraded to 7.3.3 from 7.2 something.  I guess the insert statment no longer
> accepts a zero lenght string like ''
> ERROR:  pg_atoi: zero-length string
>
> Is there a way to make this work so it will put Null in the place of it?

Note that previously empty strings were treated as zero, not null (unlike
when using Oracle) when used for numeric values.

It is hard to give you concrete advice without knowing more about how
the data is collected. But having the application emit NULL or '0' (depending
on which you want) instead of '' is probably the way you want to go (if you
can). If you are using COPY, then there is a way to say that the empty
string represents a NULL.