Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs) - Mailing list pgsql-general

From Konstantin Izmailov
Subject Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)
Date
Msg-id AANLkTik4TymbagSEVGvcX8GCo4GyndealPtiZ8bqRzYX@mail.gmail.com
Whole thread Raw
In response to Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)  (Konstantin Izmailov <pgfizm@gmail.com>)
Responses Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)  (Konstantin Izmailov <pgfizm@gmail.com>)
List pgsql-general
Looks like other people were asking similar question, but there is no answer: http://forums.devshed.com/postgresql-help-21/combine-prepare-and-declare-cursor-437562.html

On Mon, Jun 28, 2010 at 1:00 AM, Konstantin Izmailov <pgfizm@gmail.com> wrote:
lol
 
Seriosly, this customer issues resulted in improvement of the way our driver prepares statements. Keeping the map of prepared statements names is actually faster than using Savepoints (less roundtrips to server).

I found that DECLARE ... CURSOR FOR ... cannot be prepared. Basically I'm looking for a way to prepare a complex query and then use cursor for reading tuples. Is this possible?
This works: PREPARE abcd AS SELECT * FROM test; EXECUTE abcd;
This does not work: PREPARE sdsdsd AS DECLARE csr1 CURSOR FOR SELECT * FROM test;
This does not work (after prepared the query): DECLARE csr1 CURSOR FOR EXECUTE abcd;
 
Thank you!
Konstantin
On Wed, Jun 23, 2010 at 9:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Scott Marlowe <scott.marlowe@gmail.com> writes:
> On Wed, Jun 23, 2010 at 10:55 PM, Konstantin Izmailov <pgfizm@gmail.com> wrote:
>> The company is not willing to upgrade from 7.4 to a later version due to
>> risk.

> The risk of upgrading is less than the risk of staying on an
> unsupported version of pgsql.  The company that won't upgrade is
> making a poorly informed decision.

Indeed.  Point out to them that 7.4 is going to be unsupported after the
end of this month:
http://wiki.postgresql.org/wiki/PostgreSQL_Release_Support_Policy

If they don't have a plan to get off of 7.4 within the pretty near
future, they're fools.

                       regards, tom lane


pgsql-general by date:

Previous
From: Mathieu De Zutter
Date:
Subject: Re: convert accented character to base character
Next
From: Tom Lane
Date:
Subject: Re: How to log query parameters instead of variables with log_min_duration_statement