Re: 7.3 -> pg_atoi: zero-length string - Mailing list pgsql-general

From Mike Mascari
Subject Re: 7.3 -> pg_atoi: zero-length string
Date
Msg-id 3DECDE69.5060600@mascari.com
Whole thread Raw
In response to Re: 7.3 -> pg_atoi: zero-length string  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Bruce Momjian wrote:
> Ben-Nes Michael wrote:
>
>>Then Why not set it to NULL
>
> Well, it is not NULL, though, it is ''.  They are not the same in
> strings (though for some dbms's they are), so I don't see why we would
> do that for numerics.
>
>>Seems logic as there is nothing between ''
>>
>>What is the solution of other dbs ( oracle, db2 .. ) to:
>>insert into table (num) value (''); ?
>
> I assume they would fail too.

Oracle doesn't fail because it converts an empty string into
NULL. So the insert succeeds if the column lacked a NOT NULL
constraint. But Oracle's treatment of empty strings as NULL *is
insane*. Not sure about DB2...

Mike Mascari
mascarm@mascari.com



pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Arrays: determining size
Next
From: Jeff Boes
Date:
Subject: pg_relcheck gone from 7.3?