Re: Domains versus polymorphic functions, redux

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Domains versus polymorphic functions, redux
Дата
Msg-id 4DE8F66F020000250003E11E@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Domains versus polymorphic functions, redux  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> A domain constraint is a constraint that is specified for a
> domain.
>   It is applied to all columns that are based on that domain, and
>   to all values cast to that domain.
> 
> If you take that literally, it means that domain constraints are
> applied
> (1) in an assignment to a table column of a domain type, and
> (2) in an explicit CAST to the domain type, and
> (3) nowhere else.
I'm curious how you jumped from "all values cast" to "explicit CAST"
and "nowhere else".  The standard does describe implicit casts.
That said, section 4.7.5 talks about supertypes and subtypes, so if
I ever want such behavior, it seems to match pretty well (on a quick
scan) to what the standard outlines there.  No need to invent
different mechanisms.
-Kevin


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Nested CASE-WHEN scoping
Следующее
От: Andrew Chernow
Дата:
Сообщение: Re: Error in PQsetvalue