6 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: 0.4 and server-side ...
FromSent OnAttachments
Dan Watson26 Sep 2007 12:52 
Michael Bayer26 Sep 2007 13:34 
Dan Watson26 Sep 2007 14:30 
Michael Bayer26 Sep 2007 17:01 
Michael Bayer26 Sep 2007 17:03 
Dan Watson27 Sep 2007 15:15 
Subject:[sqlalchemy] Re: 0.4 and server-side cursors
From:Dan Watson (dcwa@gmail.com)
Date:09/27/2007 03:15:18 PM
List:com.googlegroups.sqlalchemy

looks like it won't work using psycopg2's named cursor implementation, at least not without some patching. it seems like psycopg should fill in cursor.description after it issues the DECLARE, but it doesn't. you can do it using one normal (non-named) cursor in SA using the method above, but it would probably require some significant work, since you'd have to transform SELECT statements into FETCH statements.

anyway, thanks for the fix!

On Sep 26, 8:01 pm, Michael Bayer <mike@zzzcomputing.com> wrote:

On Sep 26, 2007, at 5:31 PM, Dan Watson wrote:

cursor.description isn't available after the DECLARE (analogous to conn.cursor("x")), but is available after a FETCH (analogous to a cur.fetchXXX()). If you want to get rid of the buffering resultproxy, you can do a "FETCH ABSOLUTE 0 FROM cursor_name" - that will make cursor.description available, and leave the SS cursor positioned before the first row.

hm does that require a second cursor ? its giving me "cant execute twice on a named cursor".

if so, the current approach we have is probably more efficient...