summaryrefslogtreecommitdiff
path: root/src/include/tcop
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-11-04 22:26:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-11-04 22:26:08 +0000
commit9bedd128d6ed83798004b3c7ddc33f33703ccf23 (patch)
tree95a475a5da180f19c69b5bcf2f6e764b1bc69ea7 /src/include/tcop
parent48912acc089a6148529f12ab0a75b1bf026f231d (diff)
downloadpostgresql-9bedd128d6ed83798004b3c7ddc33f33703ccf23.tar.gz
Add support for invoking parser callback hooks via SPI and in cached plans.
As proof of concept, modify plpgsql to use the hooks. plpgsql is still inserting $n symbols textually, but the "back end" of the parsing process now goes through the ParamRef hook instead of using a fixed parameter-type array, and then execution only fetches actually-referenced parameters, using a hook added to ParamListInfo. Although there's a lot left to be done in plpgsql, this already cures the "if (TG_OP = 'INSERT' and NEW.foo ...)" problem, as illustrated by the changed regression test.
Diffstat (limited to 'src/include/tcop')
-rw-r--r--src/include/tcop/tcopprot.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index b1c8b77bd5..103a22fbc5 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.100 2009/09/01 00:09:42 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.101 2009/11/04 22:26:07 tgl Exp $
*
* OLD COMMENTS
* This file was created so that other c files could get the two
@@ -49,6 +49,10 @@ extern List *pg_parse_and_rewrite(const char *query_string,
extern List *pg_parse_query(const char *query_string);
extern List *pg_analyze_and_rewrite(Node *parsetree, const char *query_string,
Oid *paramTypes, int numParams);
+extern List *pg_analyze_and_rewrite_params(Node *parsetree,
+ const char *query_string,
+ ParserSetupHook parserSetup,
+ void *parserSetupArg);
extern PlannedStmt *pg_plan_query(Query *querytree, int cursorOptions,
ParamListInfo boundParams);
extern List *pg_plan_queries(List *querytrees, int cursorOptions,