Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Pau Tallada
Hi Michael, Thank you very much for your response :) The problem is that numpy requires a list of tuples, just what the low-level cursor provides. I just wanted to avoid the conversion to dict and back again to a tuple. Thank you very much! 2013/4/29 Michael Bayer > > On Apr 29, 2013, at 9:49

Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Richard Gerd Kuesters
Mike, I know that's the *supposed* behaviour. I'm just telling you that when I have stream_results enabled, I get errors on create_all() / drop_all() :-) Cheers, Richard. On 04/29/2013 02:06 PM, Michael Bayer wrote: Well stream_results is only valid with a SELECT statement. To use PG serve

Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Michael Bayer
On Apr 29, 2013, at 9:49 AM, Pau Tallada wrote: > Hi, > > I have some very big datasets that we want to process in batches of > reasonable size. > In order to do that, we enable the 'stream_results' execution option > (available in Postgresql) and we use the fetchmany method to retrieve the

Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Michael Bayer
Well stream_results is only valid with a SELECT statement. To use PG server side cursors as much as possible, what you need to do is do create_engine() with server_side_cursors=True which will take effect for any SELECT statements, but not any CREATE/DROP/INSERT/UPDATE/DELETE. This is a PG sp

Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Richard Gerd Kuesters
Well, just to add: if I run my application (using psycopg2) with stream_results=True, I get some weird errors also; even on create_all() or drop_all() commands, which I think are pretty basic. Or is it mixing the commands and not executing in order? On 04/29/2013 01:55 PM, Michael Bayer wrote

Re: [sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Michael Bayer
Well seems like the "stream_results" feature must be extremely unpopular because I can confirm this behavior even using connection-local execution options, in 0.7 also.This feature is tested so will have to see exactly what's up with those tests. On Apr 29, 2013, at 9:49 AM, Pau Tallada w

[sqlalchemy] rs.cursor.fetchall is skipping the first record when stream_results is True

2013-04-29 Thread Pau Tallada
Hi, I have some very big datasets that we want to process in batches of reasonable size. In order to do that, we enable the 'stream_results' execution option (available in Postgresql) and we use the fetchmany method to retrieve the records in batches. With those records we must build a numpy array