Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)

From: Konstantin Izmailov <pgfizm(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)
Date: 2010-06-28 08:00:50
Message-ID: AANLkTilE9zjOckBbxk7N6_78mxCi9WQRGeFxDqhPJI29@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> writes:
> > On Wed, Jun 23, 2010 at 10:55 PM, Konstantin Izmailov <pgfizm(at)gmail(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Max Williams 2010-06-28 09:29:29 How to log query parameters instead of variables with log_min_duration_statement
Previous Message Tom Lane 2010-06-27 18:12:54 Re: vacuum won't fix tx wraparound problem