Re: Weird prepared stmt behavior - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Weird prepared stmt behavior
Date
Msg-id 14236.1083602240@sss.pgh.pa.us
Whole thread Raw
In response to Re: Weird prepared stmt behavior  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: Weird prepared stmt behavior  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-hackers
> On Sat, May 01, 2004 at 10:16:56PM -0000, Greg Sabino Mullane wrote:
>> 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.

I think Greg's concern is overblown, and would result in an effectively
unusable facility if we did implement it that way.  As an example,
adding an index to a table *should* result in flushing of cached plans
for that table (maybe the query can make good use of the new index),
but people would be quite unhappy if already-prepared statements for the
table just stopped working.  More generally, the flush mechanism will
probably be written in a way that causes plan flushes to occur for
events that aren't even user-visible --- such as VACUUM FULL relocating
the catalog tuple that describes an object used by the plan.

If we re-parse from source then we will detect any changes that make the
query visibly incorrect.  I don't really see that the user can have any
beef if he continues to use a prepared statement whose source text would
have a valid but incompatible meaning due to changes elsewhere.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: inconsistent owners in newly created databases?
Next
From: Thomas Swan
Date:
Subject: Re: inconsistent owners in newly created databases?