pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14235: inconsistencies with IS NULL / IS NOT NULL
Date: Fri, 22 Jul 2016 19:40:15 -0400
Message-ID: <17567.1469230815@sss.pgh.pa.us> (raw)
In-Reply-To: <87zip9qti4.fsf@news-spur.riddles.org.uk>
References: <20160708024746.1410.57282@wrigleys.postgresql.org>
	<8760sg96u2.fsf@news-spur.riddles.org.uk>
	<10227.1469218904@sss.pgh.pa.us>
	<87zip9qti4.fsf@news-spur.riddles.org.uk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> That said, there may also be merit in arguing that the spec is just
> broken on this point. I think back when IS NULL was originally changed
> to conform to the spec, it might have been better to just say "no,
> that's silly" and stick with the old behavior.

> We wouldn't strictly speaking be violating the spec if we did that,
> because we don't claim to support feature T051 "Row types", and so we
> can just say that our row types are a nonstandard extension without the
> standard IS NULL behavior. We do in fact violate the spec here in many
> ways; for example we treat types from CREATE TYPE foo AS (fields) as
> being row types, but in fact the spec says these are user-defined
> structured types and not row types.

> But whether it would be a good idea to actually revert to the old
> way... that's another question. Does anyone actually _want_ the spec
> behavior of IS [NOT] NULL?

Good question.  The existing behavior seems to be traceable as far back as
68d9fbeb5511d846ce3a6f66b8955d3ca55a4b76, which implemented the specific
syntax ROW( ... ) IS [NOT] NULL by dint of breaking the ROW construct into
its field expressions and applying scalar NullTest to each one.  I can't
find anything in the mail archives discussing it specifically, and it was
only a very minor element of that patch.  I strongly suspect that Lockhart
just did what the spec said without thinking about it much; there is
certainly no trace of user requests for this behavior.

Later on we improved it to be less inconsistent with other ways of
specifying a rowtype argument, but again I don't see much indication of
user requests driving that, see here:
https://www.postgresql.org/message-id/flat/451BDB28.4050201%40sigaev.ru

But the other side of the coin is that the behavior does date back ten
years or more.  Between backwards compatibility worries and the quite
clear language of the spec, it's a bit hard to summon the conviction to
say we ought to change it, much as I'd like to.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (13+ messages)  latest in thread

Message-ID: <17567.1469230815@sss.pgh.pa.us>
Permalink:  ../17567.1469230815@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17567.1469230815@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk
  Subject: Re: BUG #14235: inconsistencies with IS NULL / IS NOT NULL
  In-Reply-To: <17567.1469230815@sss.pgh.pa.us>
  References: <20160708024746.1410.57282@wrigleys.postgresql.org> <8760sg96u2.fsf@news-spur.riddles.org.uk> <10227.1469218904@sss.pgh.pa.us> <87zip9qti4.fsf@news-spur.riddles.org.uk> <17567.1469230815@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox