From c902ad9ca950fa1e6577ee3d13d96d4e78e84606 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 29 Jul 2010 23:16:41 +0000 Subject: Improved version of patch to protect pg_get_expr() against misuse: look through join alias Vars to avoid breaking join queries, and move the test to someplace where it will catch more possible ways of calling a function. We still ought to throw away the whole thing in favor of a data-type-based solution, but that's not feasible in the back branches. This needs to be back-patched further than 9.0, but I don't have time to do so today. Committing now so that the fix gets into 9.0beta4. --- src/include/parser/parse_func.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/include/parser') diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index 3800f287598..0b68c0e0a10 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_func.h,v 1.68 2010/01/02 16:58:07 momjian Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_func.h,v 1.68.6.1 2010/07/29 23:16:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -82,4 +82,6 @@ extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes, extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError); +extern void check_pg_get_expr_args(ParseState *pstate, Oid fnoid, List *args); + #endif /* PARSE_FUNC_H */ -- cgit v1.2.3