Re: BUG #6064: != NULL, <> NULL do not work [sec=UNCLASSIFIED]

From: "Pilling, Michael" <Michael(dot)Pilling(at)dsto(dot)defence(dot)gov(dot)au>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, <craig(at)postnewspapers(dot)com(dot)au>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6064: != NULL, <> NULL do not work [sec=UNCLASSIFIED]
Date: 2011-06-20 00:30:59
Message-ID: DB2FF420856DB942829BF029A7E3C196029E3CB8@ednex514.dsto.defence.gov.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs



>> The real problem here then is that the documentation showing
>> the boolean comparison operators does not mention this

> This page does, at length:

But not in the table, in fact it doesn't even mention the IS NULL, IS NOT NULL operators at all.

>http://www.postgresql.org/docs/9.0/interactive/functions-comparison.html

>What page are you looking at?
I was looking at that page but didn't read the detail because I thought the information was in the
table and the detail was just textual examples. In so much of the documentation, the rest of the page
just writes out in long hand what can be inferred from the syntax. People do not read online like a book,
they scan. If the information is not upfront it just won't be seen.

>> And indeed the parser does not generate warnings either.

>It would be totally wrong for the parser to generate warnings about
>correct behavior.

The behaviour of the generated code may well be correct and indeed I agree that it is but from
everything you and the detailed documentation have said column != NULL is at least deprecated
and is highly likely to indicate a programming error. It is totally normal for a parser to warn
against archaic or dangerous constructs. The idea being to avoid subtle runtime bugs that are
hard to track down. This happens in Ada, Java and even C and many other languages.

Regards,
Michael

IMPORTANT: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Craig Ringer 2011-06-20 00:35:10 Re: BUG #6064: != NULL, <> NULL do not work [sec=UNCLASSIFIED]
Previous Message Pilling, Michael 2011-06-20 00:15:57 Re: BUG #6064: != NULL, <> NULL do not work [sec=UNCLASSIFIED]