Re: retrieving parts of a resultset - Mailing list pgsql-general

From Christopher Browne
Subject Re: retrieving parts of a resultset
Date
Msg-id m31xp7j6kn.fsf@wolfe.cbbrowne.com
Whole thread Raw
In response to retrieving parts of a resultset  (Christoffer Gurell <orbit@0x63.nu>)
Responses JOIN where you want null columns  (Steve Manes <smanes@magpie.com>)
List pgsql-general
A long time ago, in a galaxy far, far away, orbit@0x63.nu (Christoffer Gurell) wrote:
>> I think you should use a cursor; you declare it, and then you fetch the
>> rows as you need them.
>
> thanks this works really nice.. just one more question .. how do i check the
> number of rows in a cursor? or do i have to do a select count(*) on the query
> i use to create the cursor?

Make sure that the count(*) query takes place in the scope of the same
transaction, and that you SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
in that transaction, otherwise the count(*) query may find different
results...
--
(reverse (concatenate 'string "gro.gultn" "@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/finances.html
Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.

pgsql-general by date:

Previous
From: "Jason Tesser"
Date:
Subject: help with query speed
Next
From: Christopher Browne
Date:
Subject: Re: Quad Xeon vs. Dual Itanium