Domains and Casting

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Domains and Casting
Дата
Msg-id 01b701c21671$c654ffd0$fe01a8c0@jester
обсуждение исходный текст
Ответы Re: Domains and Casting  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
In order to make domains spec compliant I've added the ability for the
executor to handle Constraint * types, which it applies appropriately.
coerce_type wraps domains with the appropriate Constraint Nodes as
required.  I've run into a rather simple problem however.

CREATE DOMAIN int4notnulldomain int4 NOT NULL;
SELECT cast(cast(NULL as int4) as int4notnulldomain);  -- constraint
applied properly

SELECT cast(NULL as int4notnulldomain); -- constraint missed.


This appears to be due to makeTypeCast() in gram.y which bypasses
creating a TypeCast node for simple A_Const.

Removing the top part of the if (always creating a TypeCast node)
causes some rather extensive failures in the regression tests,
specifically with 'int4'::regproc type constructs.

Any advice?
--
Rod



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

Предыдущее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Massive regression failures
Следующее
От: David Ford
Дата:
Сообщение: Re: PostGres Doubt