We neglected to apply domain constraints on UNKNOWN parameters to
authorNeil Conway <neilc@samurai.com>
Thu, 12 Jan 2006 22:29:11 +0000 (22:29 +0000)
committerNeil Conway <neilc@samurai.com>
Thu, 12 Jan 2006 22:29:11 +0000 (22:29 +0000)
prepared statements, per report from David Wheeler.

src/backend/parser/parse_coerce.c

index 482f55f9897b2b0fa136cd2fc108eb17474d47f1..8666015f34551ff934dbaf4de337bd5c280011f2 100644 (file)
@@ -243,7 +243,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))