Re: Re: User-defined operator function: what parameter type to use for uncast character string?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: User-defined operator function: what parameter type to use for uncast character string?
Дата
Msg-id 1536.1406907918@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Re: User-defined operator function: what parameter type to use for uncast character string?  (Adam Mackler <pgsql-general@mackler.org>)
Список pgsql-general
Adam Mackler <pgsql-general@mackler.org> writes:
> One final question: the 'CREATE CAST' command got my interest.  I'm
> assuming that when the docs say it 'performs a conversion between two
> data types,' that the meaning of "data type" includes only those
> created using 'CREATE TYPE' and excludes domains.  If I am mistaken on
> that point I would be grateful to learn of that mistake.

I wouldn't recommend it.  The expected behavior of up-casting to a domain
from its base type is that the value doesn't change but the domain's
current check constraints are applied.  I think that if you defined
a cast via CREATE CAST it would override that behavior (I've not verified
this though), and it would then be entirely on your head whether the
resulting value was actually a legal member of the domain.

            regards, tom lane


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

Предыдущее
От: Larry White
Дата:
Сообщение: jsonb creation functions?
Следующее
От: Vik Fearing
Дата:
Сообщение: Re: Feature proposal and discussion: full-fledged column/function equivalence