pgsql: PREPARE and EXPLAIN need to copy the source query just like we

Started by Tom Laneover 21 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
PREPARE and EXPLAIN need to copy the source query just like we recently
had to do in DECLARE CURSOR. AFAICS these are all the places affected.
PREPARE case per example from Michael Fuhr, EXPLAIN case located by
grepping for planner calls ...

Modified Files:
--------------
pgsql/src/backend/commands:
explain.c (r1.127 -> r1.128)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/explain.c.diff?r1=1.127&r2=1.128)
prepare.c (r1.34 -> r1.35)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c.diff?r1=1.34&r2=1.35)

#2Sean Chittenden
sean@chittenden.org
In reply to: Tom Lane (#1)
Re: pgsql: PREPARE and EXPLAIN need to copy the source query just like we

PREPARE and EXPLAIN need to copy the source query just like we recently
had to do in DECLARE CURSOR. AFAICS these are all the places affected.
PREPARE case per example from Michael Fuhr, EXPLAIN case located by
grepping for planner calls ...

Does this mean that cache lookup failures (most notably in pl/pgsql)
will simply result in a replan as opposed to a query failure and the
transaction being aborted? Or is this a first step in that direction?
-sc

--
Sean Chittenden

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sean Chittenden (#2)
Re: pgsql: PREPARE and EXPLAIN need to copy the source query just like we

Sean Chittenden <sean@chittenden.org> writes:

PREPARE and EXPLAIN need to copy the source query just like we recently
had to do in DECLARE CURSOR. AFAICS these are all the places affected.
PREPARE case per example from Michael Fuhr, EXPLAIN case located by
grepping for planner calls ...

Does this mean that cache lookup failures (most notably in pl/pgsql)
will simply result in a replan as opposed to a query failure and the
transaction being aborted? Or is this a first step in that direction?

No, and no. This has no user-visible impact at all (other than not
crashing in cases that should work).

regards, tom lane