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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #2873: Function that returns an empty set with a 'not null' domain errors in 8.2 but not 8.1
Дата
Msg-id 7321.1168354583@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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>)
Ответы Re: [BUGS] BUG #2873: Function that returns an empty set  ("Andrew Dunstan" <andrew@dunslane.net>)
Список 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 по дате отправления:

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: 8.3 pending patch queue
Следующее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: [BUGS] BUG #2873: Function that returns an empty set