From 1d97c19a0f748e94b9582dcbaec33ad74be062f9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 19 Apr 2009 19:46:33 +0000 Subject: Fix estimate_num_groups() to not fail on PlaceHolderVars, per report from Stefan Kaltenbrunner. The most reasonable behavior (at least for the near term) seems to be to ignore the PlaceHolderVar and examine its argument instead. In support of this, change the API of pull_var_clause() to allow callers to request recursion into PlaceHolderVars. Currently estimate_num_groups() is the only customer for that behavior, but where there's one there may be others. --- src/backend/catalog/heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/catalog/heap.c') diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index f6b52109fe..bc03ef6033 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.352 2009/03/31 17:59:56 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.353 2009/04/19 19:46:32 tgl Exp $ * * * INTERFACE ROUTINES @@ -1621,7 +1621,7 @@ StoreRelCheck(Relation rel, char *ccname, Node *expr, * in check constraints; it would fail to examine the contents of * subselects. */ - varList = pull_var_clause(expr, false); + varList = pull_var_clause(expr, PVC_REJECT_PLACEHOLDERS); keycount = list_length(varList); if (keycount > 0) @@ -1915,7 +1915,7 @@ AddRelationNewConstraints(Relation rel, List *vars; char *colname; - vars = pull_var_clause(expr, false); + vars = pull_var_clause(expr, PVC_REJECT_PLACEHOLDERS); /* eliminate duplicates */ vars = list_union(NIL, vars); -- cgit v1.2.1