aboutsummaryrefslogtreecommitdiff
path: root/src/include/parser/parse_param.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-10-31 01:41:31 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-10-31 01:41:31 +0000
commitfb5d05805b3f7658e47ad2c6a4631e497bb3f627 (patch)
tree74ee6327b45c313ac0ac21e92a3d61a52135cd2f /src/include/parser/parse_param.h
parent8442317beb8fb6f180880a977c03ccae4304df25 (diff)
downloadpostgresql-fb5d05805b3f7658e47ad2c6a4631e497bb3f627.tar.gz
postgresql-fb5d05805b3f7658e47ad2c6a4631e497bb3f627.zip
Implement parser hooks for processing ColumnRef and ParamRef nodes, as per my
recent proposal. As proof of concept, remove knowledge of Params from the core parser, arranging for them to be handled entirely by parser hook functions. It turns out we need an additional hook for that --- I had forgotten about the code that handles inferring a parameter's type from context. This is a preliminary step towards letting plpgsql handle its variables through parser hooks. Additional work remains to be done to expose the facility through SPI, but I think this is all the changes needed in the core parser.
Diffstat (limited to 'src/include/parser/parse_param.h')
-rw-r--r--src/include/parser/parse_param.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/parser/parse_param.h b/src/include/parser/parse_param.h
new file mode 100644
index 00000000000..1423cde97c6
--- /dev/null
+++ b/src/include/parser/parse_param.h
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ *
+ * parse_param.h
+ * handle parameters in parser
+ *
+ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/parser/parse_param.h,v 1.1 2009/10/31 01:41:31 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PARSE_PARAM_H
+#define PARSE_PARAM_H
+
+#include "parser/parse_node.h"
+
+extern void parse_fixed_parameters(ParseState *pstate,
+ Oid *paramTypes, int numParams);
+extern void parse_variable_parameters(ParseState *pstate,
+ Oid **paramTypes, int *numParams);
+extern void check_variable_parameters(ParseState *pstate, Query *query);
+
+#endif /* PARSE_PARAM_H */