From: | Raimon Fernandez <coder(at)montx(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | John DeSoi <desoi(at)pgedit(dot)com>, pgsql-general List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Extended Query, flush or sync ? |
Date: | 2009-12-23 09:24:42 |
Message-ID: | F7F5998E-FB6D-409A-9FAA-53F1824A8ED3@montx.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-interfaces |
On 22/12/2009, at 18:15, Tom Lane wrote:
> Raimon Fernandez <coder(at)montx(dot)com> writes:
>> But the portal isn't destroyed after a sync ?
>
> Not directly by a Sync, no.
>
>> I'm getting a "Portal 'myPortal' doesn't exist "when sending the next Execute ...
>
> End of transaction would destroy portals --- are you holding a
> transaction open for this? It's basically just like a cursor.
OK, after re-reading your email and the docs again and again, I see that portals must be inside a transaction, now it's working ...
Here are my steps:
- parse the Selects
...
- start transaction
- bind using a prepared statement name and a portal name
- execute x n
- close transaction
...
is this the correct way ?
And in the case I limit the execute, how I can get the pending rows ?
I'm using a CURSOR with the portal just created, and it works perfectly.
Using a new execute, I'm getting again the previous rows plus the new ones, and with the CURSOR, only the pending rows ...
Is this the correct way ?
And, where I can get more info about when it's better to use an extended query, a portal, a cursor, a simple query, ... ?
thanks!
regards,
raimon
From | Date | Subject | |
---|---|---|---|
Next Message | Sim Zacks | 2009-12-23 10:00:59 | reindex |
Previous Message | Jayadevan M | 2009-12-23 08:32:13 | Re: PostgreSQL and character set change |
From | Date | Subject | |
---|---|---|---|
Next Message | Joachim Wieland | 2010-02-17 08:39:18 | Listen/Notify payload and interfaces |
Previous Message | Raimon Fernandez | 2009-12-22 18:56:04 | Re: Extended Query, flush or sync ? |