From d04db370720ece56ffcad54e46cf03483c742ebb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 Jan 2009 15:46:11 +0000 Subject: Arrange for function default arguments to be processed properly in expressions that are set up for execution with ExecPrepareExpr rather than going through the full planner process. By introducing an explicit notion of "expression planning", this patch also lays a bit of groundwork for maybe someday allowing sub-selects in standalone expressions. --- src/backend/commands/typecmds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/commands') diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index f660a57da23..1bd0ef2cd13 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.129 2009/01/01 17:23:40 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.130 2009/01/09 15:46:10 tgl Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -50,7 +50,7 @@ #include "executor/executor.h" #include "miscadmin.h" #include "nodes/makefuncs.h" -#include "optimizer/planmain.h" +#include "optimizer/planner.h" #include "optimizer/var.h" #include "parser/parse_coerce.h" #include "parser/parse_expr.h" @@ -2390,8 +2390,8 @@ GetDomainConstraints(Oid typeOid) check_expr = (Expr *) stringToNode(TextDatumGetCString(val)); - /* ExecInitExpr assumes we already fixed opfuncids */ - fix_opfuncids((Node *) check_expr); + /* ExecInitExpr assumes we've planned the expression */ + check_expr = expression_planner(check_expr); r = makeNode(DomainConstraintState); r->constrainttype = DOM_CONSTRAINT_CHECK; -- cgit v1.2.3