Re: [Re] Re: PREPARE and transactions - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [Re] Re: PREPARE and transactions
Date
Msg-id 20040624165916.GC2761@dcc.uchile.cl
Whole thread Raw
In response to [Re] Re: PREPARE and transactions  ("Cyril VELTER" <cyril.velter@metadys.com>)
Responses Re: [Re] Re: PREPARE and transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
[Re] Re: [Re] Re: PREPARE and transactions  ("Cyril VELTER" <cyril.velter@metadys.com>)
List pgsql-hackers
On Thu, Jun 24, 2004 at 05:11:48PM +0200, Cyril VELTER wrote:
> 
> Just my 2 cents here. I agree with tom that the curent behevior for the v3 
> protocol is the right one.    I use "On demand" preparation. The first time a 
> statement is needed for a specific connection, it is prepared and the client 
> keep track of that (reusing the prepared statement for subsequent calls). If 
> the transaction where the statement is prepared is aborted for whatever reason, 
> the prepared statement MUST remain valid for this to work, otherwise I need to 
> track if the transaction where the statement have been prepared commited or not 
> and invalidate it if it's not the case.

This is why I proposed originally to keep the non-transactional behavior
for Parse messages, but transactional for SQL PREPARE.  The latter can
be said to be inside the transaction and should behave like so.  I think
this lowers the surprise factor.

-- 
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)



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 7.5-dev, pg_dumpall, dollarquoting
Next
From: Alvaro Herrera
Date:
Subject: Re: bug in GUC