From: | Federico Di Gregorio <federico(dot)digregorio(at)dndg(dot)it> |
---|---|
To: | psycopg(at)postgresql(dot)org, deavidsedice(at)gmail(dot)com |
Subject: | Re: Named Cursors WITH HOLD |
Date: | 2011-07-05 08:29:58 |
Message-ID: | 4E12CB86.70503@dndg.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
On 05/07/11 09:07, deavid wrote:
> Hi, i'm using psycopg and i'm noticing that Named Cursors are being
> deleted by PostgreSQL whenever i do a commit. This is the default
> behaviour specified in [1], but there is a parameter when creating a
> cursor called "WITH HOLD" that allows a cursor outside any
> transaction.
I first try at WITH HOLD is available from the devel branch:
git://luna.dndg.it/public/psycopg2
Example code:
curs = conn.cursort("NAME")
curs.withhold = True
curs.execute("SELECT ...");
conn.commit()
curs.fetchXXX()
It should work. If it doesn't work please report any bug so that we can
fix them before the release.
federico
--
Federico Di Gregorio federico(dot)digregorio(at)dndg(dot)it
Studio Associato Di Nunzio e Di Gregorio http://dndg.it
The only thing I see is if you are pumping so much data into the
database all the time when do you expect to look at it?
-- Charlie Clark
From | Date | Subject | |
---|---|---|---|
Next Message | Federico Di Gregorio | 2011-07-05 08:35:36 | Re: Named Cursors WITH HOLD |
Previous Message | Federico Di Gregorio | 2011-07-05 07:26:59 | Re: Named Cursors WITH HOLD |