Re: Fwd: int type problem in 7.3 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fwd: int type problem in 7.3
Date
Msg-id 22054.1033564388@sss.pgh.pa.us
Whole thread Raw
In response to Fwd: int type problem in 7.3  (Mario Weilguni <mweilguni@sime.com>)
List pgsql-hackers
Mario Weilguni <mweilguni@sime.com> writes:
> Ok, I checked this again. Up until 7.2, it was possible to compare an empty string to a number, and it worked::
> e.g.: select * from mytable where int4id='' 
> worked fine, but delivered no result.

No, that was not what it did: in reality, the '' was silently taken as
zero, and would match rows containing 0.  That seems a very error-prone
behavior (not to say a flat-out bug) to me.

> But oracle accepts this one:
> SQL> select * from re_eintraege where id='';
> no rows selected
> because oracle treats the empty string as NULL

Oracle does that for string data, but it doesn't do it for numerics
does it?  In any case, that behavior is surely non-compliant with
the SQL spec.

We were not compatible with Oracle on this behavior before, and I'm
not very inclined to become so now.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: some more minor incompatibilties 7.2 <-> 7.3
Next
From: Tom Lane
Date:
Subject: Re: (Fwd) Re: Any Oracle 9 users? A test please...