Log Message: ----------- 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.
Modified Files: -------------- pgsql/src/backend/commands: copy.c (r1.282 -> r1.283) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/copy.c.diff?r1=1.282&r2=1.283) explain.c (r1.161 -> r1.162) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/explain.c.diff?r1=1.161&r2=1.162) portalcmds.c (r1.64 -> r1.65) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c.diff?r1=1.64&r2=1.65) prepare.c (r1.74 -> r1.75) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c.diff?r1=1.74&r2=1.75) pgsql/src/backend/executor: execMain.c (r1.292 -> r1.293) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execMain.c.diff?r1=1.292&r2=1.293) functions.c (r1.115 -> r1.116) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c.diff?r1=1.115&r2=1.116) spi.c (r1.178 -> r1.179) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c.diff?r1=1.178&r2=1.179) pgsql/src/backend/nodes: copyfuncs.c (r1.374 -> r1.375) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c.diff?r1=1.374&r2=1.375) equalfuncs.c (r1.305 -> r1.306) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c.diff?r1=1.305&r2=1.306) outfuncs.c (r1.305 -> r1.306) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c.diff?r1=1.305&r2=1.306) readfuncs.c (r1.205 -> r1.206) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/readfuncs.c.diff?r1=1.205&r2=1.206) pgsql/src/backend/optimizer/plan: planagg.c (r1.31 -> r1.32) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planagg.c.diff?r1=1.31&r2=1.32) planner.c (r1.217 -> r1.218) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c.diff?r1=1.217&r2=1.218) pgsql/src/backend/optimizer/prep: prepjointree.c (r1.47 -> r1.48) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c.diff?r1=1.47&r2=1.48) pgsql/src/backend/optimizer/util: clauses.c (r1.241 -> r1.242) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c.diff?r1=1.241&r2=1.242) pgsql/src/backend/parser: analyze.c (r1.362 -> r1.363) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/analyze.c.diff?r1=1.362&r2=1.363) gram.y (r2.590 -> r2.591) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y.diff?r1=2.590&r2=2.591) parse_clause.c (r1.164 -> r1.165) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_clause.c.diff?r1=1.164&r2=1.165) parse_expr.c (r1.216 -> r1.217) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_expr.c.diff?r1=1.216&r2=1.217) parse_type.c (r1.88 -> r1.89) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_type.c.diff?r1=1.88&r2=1.89) pgsql/src/backend/rewrite: rewriteDefine.c (r1.119 -> r1.120) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteDefine.c.diff?r1=1.119&r2=1.120) pgsql/src/backend/tcop: pquery.c (r1.115 -> r1.116) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/pquery.c.diff?r1=1.115&r2=1.116) utility.c (r1.278 -> r1.279) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/utility.c.diff?r1=1.278&r2=1.279) pgsql/src/include/commands: portalcmds.h (r1.22 -> r1.23) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/portalcmds.h.diff?r1=1.22&r2=1.23) pgsql/src/include/nodes: parsenodes.h (r1.347 -> r1.348) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h.diff?r1=1.347&r2=1.348) plannodes.h (r1.93 -> r1.94) (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/plannodes.h.diff?r1=1.93&r2=1.94) ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq