Re: [BUGS] BUG #2873: Function that returns an empty set with a 'not null' domain errors in 8.2 but not 8.1 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] BUG #2873: Function that returns an empty set with a 'not null' domain errors in 8.2 but not 8.1
Date
Msg-id 7321.1168354583@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] BUG #2873: Function that returns an empty set with a 'not null' domain errors in 8.2 but not 8.1  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: [BUGS] BUG #2873: Function that returns an empty set
List pgsql-hackers
"Jim C. Nasby" <jim@nasby.net> writes:
> Perhaps a means to mark the record as being null, other than setting all
> the fields to null?

We could probably bypass the call of the domain input function, thereby
avoiding the elog, but the point remains: if we do that, then we have
a NOT-NULL-constrained domain variable that is reading out as NULL.
One way or another we're going to be violating somebody's expectation.

(BTW, I suspect that the case "DECLARE foo nonnulldomain;" already has
this issue, as I think that code path just stores a null without any
ceremony.)

This is closely related to the discussion a couple weeks ago about how
a LEFT JOIN could produce nulls in an output column that was labeled as
having a non-null-domain type.  We haven't figured out what is a sane
behavior for that case, either.  I'm beginning to think that domains
constrained not null are just fundamentally a bad idea.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: 8.3 pending patch queue
Next
From: "Andrew Dunstan"
Date:
Subject: Re: [BUGS] BUG #2873: Function that returns an empty set