We neglected to apply domain constraints on UNKNOWN parameters to
authorNeil Conway <[email protected]>
Thu, 12 Jan 2006 22:29:22 +0000 (22:29 +0000)
committerNeil Conway <[email protected]>
Thu, 12 Jan 2006 22:29:22 +0000 (22:29 +0000)
prepared statements, per report from David Wheeler.

src/backend/parser/parse_coerce.c

index 763e01cd7d04053f15223dde4a3d24b916923877..838ff01a7de58df29707d548960d32a39ad40f7b 100644 (file)
@@ -242,7 +242,10 @@ coerce_type(ParseState *pstate, Node *node,
                }
 
                param->paramtype = targetTypeId;
-               return (Node *) param;
+
+               /* Apply domain constraints, if necessary */
+               return coerce_to_domain((Node *) param, InvalidOid, targetTypeId,
+                                                               cformat, false, false);
        }
        if (find_coercion_pathway(targetTypeId, inputTypeId, ccontext,
                                                          &funcId))