From fb5d05805b3f7658e47ad2c6a4631e497bb3f627 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 31 Oct 2009 01:41:31 +0000 Subject: 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. --- src/backend/parser/parse_node.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/backend/parser/parse_node.c') diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index f775850e049..0dea02c71b5 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.105 2009/06/11 14:49:00 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.106 2009/10/31 01:41:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,12 @@ make_parsestate(ParseState *parentParseState) if (parentParseState) { pstate->p_sourcetext = parentParseState->p_sourcetext; - pstate->p_variableparams = parentParseState->p_variableparams; + /* all hooks are copied from parent */ + pstate->p_pre_columnref_hook = parentParseState->p_pre_columnref_hook; + pstate->p_post_columnref_hook = parentParseState->p_post_columnref_hook; + pstate->p_paramref_hook = parentParseState->p_paramref_hook; + pstate->p_coerce_param_hook = parentParseState->p_coerce_param_hook; + pstate->p_ref_hook_state = parentParseState->p_ref_hook_state; } return pstate; -- cgit v1.2.3