Skip site navigation (1) Skip section navigation (2)

pgsql: Modify processing of DECLARE CURSOR and EXPLAIN so that they can

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Modify processing of DECLARE CURSOR and EXPLAIN so that they can
Date: 2007-04-27 22:05:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
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:
        copy.c (r1.282 -> r1.283)
        explain.c (r1.161 -> r1.162)
        portalcmds.c (r1.64 -> r1.65)
        prepare.c (r1.74 -> r1.75)
        execMain.c (r1.292 -> r1.293)
        functions.c (r1.115 -> r1.116)
        spi.c (r1.178 -> r1.179)
        copyfuncs.c (r1.374 -> r1.375)
        equalfuncs.c (r1.305 -> r1.306)
        outfuncs.c (r1.305 -> r1.306)
        readfuncs.c (r1.205 -> r1.206)
        planagg.c (r1.31 -> r1.32)
        planner.c (r1.217 -> r1.218)
        prepjointree.c (r1.47 -> r1.48)
        clauses.c (r1.241 -> r1.242)
        analyze.c (r1.362 -> r1.363)
        gram.y (r2.590 -> r2.591)
        parse_clause.c (r1.164 -> r1.165)
        parse_expr.c (r1.216 -> r1.217)
        parse_type.c (r1.88 -> r1.89)
        rewriteDefine.c (r1.119 -> r1.120)
        pquery.c (r1.115 -> r1.116)
        utility.c (r1.278 -> r1.279)
        portalcmds.h (r1.22 -> r1.23)
        parsenodes.h (r1.347 -> r1.348)
        plannodes.h (r1.93 -> r1.94)

pgsql-committers by date

Next:From: Neil ConwayDate: 2007-04-28 23:54:59
Subject: pgsql: Add support for IN as alternative to FROM in PL/PgSQL's FETCH
Previous:From: Neil ConwayDate: 2007-04-27 20:08:43
Subject: pgsql: Remove no-longer-true statement from the docs.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group