[GENERAL] Cursor not getting all rows

2005-05-17 Thread Joseph Shraibman
I'm running: PostgreSQL 7.4.7 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I do this: BEGIN; SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ; DECLARE cname CURSOR FOR SELECT u.field, d.field FROM u, d WHERE u.id = d.id AND ... ; At the end of the

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 12:19, Joseph Shraibman wrote: I'm running: PostgreSQL 7.4.7 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I do this: BEGIN; SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ; DECLARE cname CURSOR FOR SELECT u.field,

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Joseph Shraibman
Scott Marlowe wrote: Only if you set transaction isolation to serializable. So am I getting data that was updated up until the time of the FETCH or the DECLARE CURSOR? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Tom Lane
Joseph Shraibman jks@selectacast.net writes: I do this: BEGIN; SELECT count(*) FROM u, d WHERE u.id = d.id AND ... ; DECLARE cname CURSOR FOR SELECT u.field, d.field FROM u, d WHERE u.id = d.id AND ... ; At the end of the fetching if the number of fetched does not equal the number from

Re: [GENERAL] Cursor not getting all rows

2005-05-17 Thread Scott Marlowe
On Tue, 2005-05-17 at 12:49, Joseph Shraibman wrote: Scott Marlowe wrote: Only if you set transaction isolation to serializable. So am I getting data that was updated up until the time of the FETCH or the DECLARE CURSOR? The data shouldn't change between the declare and the fetch, it's