diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-31 01:41:31 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-31 01:41:31 +0000 |
commit | fb5d05805b3f7658e47ad2c6a4631e497bb3f627 (patch) | |
tree | 74ee6327b45c313ac0ac21e92a3d61a52135cd2f /src/backend/parser/parse_node.c | |
parent | 8442317beb8fb6f180880a977c03ccae4304df25 (diff) | |
download | postgresql-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/backend/parser/parse_node.c')
-rw-r--r-- | src/backend/parser/parse_node.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; |