Re: PostgreSQL domains and NOT NULL constraint

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: PostgreSQL domains and NOT NULL constraint
Дата
Msg-id 8fbc4e88-036a-45cc-bb20-eab044a73013@postgresfriends.org
обсуждение исходный текст
Ответ на Re: PostgreSQL domains and NOT NULL constraint  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: PostgreSQL domains and NOT NULL constraint
Список pgsql-hackers
On 10/23/23 18:53, Tom Lane wrote:
> 1. Domains are data types, with the proviso that NULL is always a valid 
> value no matter what the domain constraints might say. 
> Implementation-wise, this'd just require that CoerceToDomain immediately 
> return any null input without checking the constraints. This has two big 
> attractions:


> (1A) It satisfies the plain language of the SQL spec about 
> how CAST to a domain type behaves.


I agree with all of your proposal, except for this part.  I think the 
shortcut in the General Rules of <cast specification> is an oversight 
and I plan on submitting a paper to fix it.  The intention is, in my 
view, clearly to check the constraints upon casting.  What other 
explanation is there since the result type is still the domain's base 
type[*]?


[*] In the standard, not in our superior implementation of it.
-- 
Vik Fearing




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Add trailing commas to enum definitions
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: LLVM 16 (opaque pointers)