]> granicus.if.org Git - postgresql/commit
Modify processing of DECLARE CURSOR and EXPLAIN so that they can resolve the
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Apr 2007 22:05:49 +0000 (22:05 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Apr 2007 22:05:49 +0000 (22:05 +0000)
commitbbbe825f5f46d7ead60502f43d3b414719a41aa5
treeb4dda033d2ecee0e6ba083621763e058ae0b7ba4
parenta264671116ab9ba45fb20441c16fe0783e52857b
Modify processing of DECLARE CURSOR and EXPLAIN so that they can resolve the
types of unspecified parameters when submitted via extended query protocol.
This worked in 8.2 but I had broken it during plancache changes.  DECLARE
CURSOR is now treated almost exactly like a plain SELECT through parse
analysis, rewrite, and planning; only just before sending to the executor
do we divert it away to ProcessUtility.  This requires a special-case check
in a number of places, but practically all of them were already special-casing
SELECT INTO, so it's not too ugly.  (Maybe it would be a good idea to merge
the two by treating IntoClause as a form of utility statement?  Not going to
worry about that now, though.)  That approach doesn't work for EXPLAIN,
however, so for that I punted and used a klugy solution of running parse
analysis an extra time if under extended query protocol.
26 files changed:
src/backend/commands/copy.c
src/backend/commands/explain.c
src/backend/commands/portalcmds.c
src/backend/commands/prepare.c
src/backend/executor/execMain.c
src/backend/executor/functions.c
src/backend/executor/spi.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/planagg.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/prepjointree.c
src/backend/optimizer/util/clauses.c
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/parse_clause.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_type.c
src/backend/rewrite/rewriteDefine.c
src/backend/tcop/pquery.c
src/backend/tcop/utility.c
src/include/commands/portalcmds.h
src/include/nodes/parsenodes.h
src/include/nodes/plannodes.h