Re: Weird prepared stmt behavior

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Weird prepared stmt behavior
Date: 2004-05-01 17:20:47
Message-ID: 20040501172047.GE2333@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 30, 2004 at 09:44:52PM -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> > Is this expected? If so, why? I'd expect the prepared stmt to be
> > deallocated.
>
> prepare.c probably should have provisions for rolling back its state to
> the start of a failed transaction ... but it doesn't.
>
> Before jumping into doing that, though, I'd want to have some
> discussions about the implications for the V3 protocol's notion of
> prepared statements. The protocol spec does not say anything that
> would suggest that prepared statements are lost on transaction rollback,
> and offhand it seems like they shouldn't be because the protocol is
> lower-level than transactions.

Right now there is no distinction between a PREPARE prepared statement
and a protocol-level one. If we want to have the v3proto's statements
behave different from PREPARE's, it's just a matter of adding a new
field into the PreparedStatement. I can do that and make them behave
different if people think this is how it should be.

I don't really have an opinion on whether protocol-level should behave
different. What do people think?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green
stamp method,", namely by saving envelopes addressed to him as 'Dr. Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree. (Don Knuth)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-05-01 20:35:30 Re: FW: Timezone library
Previous Message Alvaro Herrera 2004-05-01 17:04:35 Re: Current CVS tip segfaulting