Re: [HACKERS] A small problem with the new inet and cidr types

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: darcy@druid.net (D'Arcy J.M. Cain)
Cc: pgsql-hackers@postgreSQL.org
Date: 1998-11-02T15:50:38Z
Lists: pgsql-hackers
darcy@druid.net (D'Arcy J.M. Cain) writes:
> OK, there are more problems.  If you apply the following patch to the
> regression tests you will crash the backend in a number of places.

Yipes!

I must withdraw my prior opinion that we should shoehorn in a repair to
the INET datatypes for this case.  It's clear that we have a wideranging
problem that ought to be fixed more globally.  But presumably it's
been there for quite a while, and we didn't know it; therefore it's not
critical enough to hold up the release.

My guess is that maybe this should not be fixed in the individual
datatypes at all; instead the generic function and operator code should
be modified so that if any input value is NULL, then NULL is returned as
the result without ever calling the datatype-specific code.

There might be specific operators for which this is not the right
behavior (although none spring to mind immediately).  In that case,
I think the best bet would be to have a per-operator flag, defaulting
to OFF, which could be turned on for those specific operators that are
prepared to cope with null inputs.

Thoughts?

			regards, tom lane