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