On Wednesday 18 October 2006 15:13, Andrew Dunstan wrote: > Andreas Joseph Krogh wrote: > > This has been been discussed before, but Oracle behaves differently, and > > IMHO in a more correct way. > > > > The following query returns NULL in PG: > > SELECT NULL || 'fisk'; > > > > But in Oracle, it returns 'fisk': > > SELECT NULL || 'fisk' FROM DUAL; > > > > The latter seems more logical... > > 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". > In any case, why should null have a string value of '' any more than it > should have a value of 'blurfl'? > > Your analogy elsewhere with aggregate functions like sum() is not > relevant, as these are documented to ignore null values. 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". -- Andreas Joseph Krogh <[EMAIL PROTECTED]> Senior Software Developer / Manager gpg public_key: http://dev.officenet.no/~andreak/public_key.asc ------------------------+---------------------------------------------+ OfficeNet AS | The most difficult thing in the world is to | Karenslyst Allé 11 | know how to do a thing and to watch | PO. Box 529 Skøyen | somebody else doing it wrong, without | 0214 Oslo | comment. | NORWAY | | Mobile: +47 909 56 963 | | ------------------------+---------------------------------------------+ ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly