Re: Catalog domain not-null constraints

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Catalog domain not-null constraints
Дата
Msg-id 804552.1711068412@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Catalog domain not-null constraints  (Vik Fearing <vik@postgresfriends.org>)
Ответы Re: Catalog domain not-null constraints  (Vik Fearing <vik@postgresfriends.org>)
Список pgsql-hackers
Vik Fearing <vik@postgresfriends.org> writes:
> On 3/22/24 00:17, Tom Lane wrote:
>> Vik Fearing <vik@postgresfriends.org> writes:
>>> As also said somewhere in that thread, I think that <cast specification>
>>> short-cutting a NULL input value without considering the constraints of
>>> a domain is a bug that needs to be fixed in the standard.

>> I think it's probably intentional.  It certainly fits with the lack of
>> syntax for DOMAIN NOT NULL.  Also, it's been like that since SQL99;
>> do you think nobody's noticed it for 25 years?

> Haven't we (postgres) had bug reports of similar age?

Well, they've looked it at it since then.  SQL99 has

    c) If SV is the null value, then the result is the null value.

SQL:2008 and later have the text I quoted:

    c) If SV is the null value, then the result of CS is the null
    value and no further General Rules of this Sub-clause are
    applied.

I find it *extremely* hard to believe that they would have added
that explicit text without noticing exactly which operations they
were saying to skip.

> Anyway, I will bring this up with the committee and report back.  My 
> proposed solution will be for CAST to check domain constraints even if 
> the input is NULL.

Please do not claim that that is the position of the Postgres project.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: SQL:2011 application time
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs