From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Andreas Joseph Krogh <andreak(at)officenet(dot)no> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: bug or feature, || -operator and NULLs |
Date: | 2006-10-18 13:57:01 |
Message-ID: | 20061018135701.GF11184@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Oct 18, 2006 at 03:44:05PM +0200, Andreas Joseph Krogh wrote:
> > When in doubt, consult the standard ... Oracle's treatment of NULL is
> > known to violate the standard, IIRC. Your measure of correctness seems
> > to be "appears to me more logical", but ours is "complies with the
> > standard".
>
> I know PG violates the standard in other places and core's favourite argument
> for doing so is "the standard is braindead here, so we do it our way".
But they're few and far between and not on things people actually
notice much.
What's being suggested simply violates common sense. Basically:
if (a = b) then (a||c = b||c)
That seems a perfectly good rule, which works for both Oracle and
PostgreSQL. Breaking seems to be a bad idea all round.
> I'm not advocating that NULL should have a string-vaule of anything, just that
> the ||-operator shuld treat NULL as "dont bother with it and proceed
> concatenation".
I would argue it's inconsistant. No other function treats a NULL like
an empty string, so I really don't see why textcat() should.
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | Lukas Kahwe Smith | 2006-10-18 14:05:18 | Re: bug or feature, || -operator and NULLs |
Previous Message | Andrew Dunstan | 2006-10-18 13:54:39 | Re: bug or feature, || -operator and NULLs |