On Sat, May 01, 2004 at 10:16:56PM -0000, Greg Sabino Mullane wrote:
> > We could imagine that once we add tracking of plan dependencies,
> > detection of a change that invalidates a prepared statement's plan
> > would just cause the prepared statement to be marked as "needs
> > recompilation". The next attempt to use it would have to re-plan
> > from source, and could get an error if there is no longer any valid
> > interpretation of the original source string.
>
> I am very uneasy about this. Statements should stay invalidated, else
> the prepared statement may no longer even do what was originally
> intended when it was first created.
OTOH, Oliver Jowett said on the JDBC list that the JDBC driver would
like to have a mechanism to non-transactionally create prepared
statements
(http://archives.postgresql.org/pgsql-jdbc/2004-05/msg00000.php)
A possible compromise is what Tom said originally: we could just have
the PREPARE command statements be discarded at rollback, but the Prepare
message's statements should be kept.
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Now I have my system running, not a byte was off the shelf;
It rarely breaks and when it does I fix the code myself.
It's stable, clean and elegant, and lightning fast as well,
And it doesn't cost a nickel, so Bill Gates can go to hell."