Re: [HACKERS] A small problem with the new inet and cidr types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] A small problem with the new inet and cidr types
Date
Msg-id 4320.910021838@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] A small problem with the new inet and cidr types  (darcy@druid.net (D'Arcy J.M. Cain))
Responses Re: [HACKERS] A small problem with the new inet and cidr types  (darcy@druid.net (D'Arcy J.M. Cain))
RE: [HACKERS] A small problem with the new inet and cidr types  ("Taral" <taral@mail.utexas.edu>)
List 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


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] A small problem with the new inet and cidr types
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] A small problem with the new inet and cidr types