Search Postgresql Archives

Re: full tuple count in cursor.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexander Cohen <alex@toomuchspace.com> writes:
> I have a cursor that i got from a select statement. I would like to 
> know how many records are in the cursor so i dont go over the last one 
> when using FETCH on the cursor. How can i do this?

You can't.  The system does not know how many rows will be in the query
until it executes it.  So the only way to obtain this information is to
FETCH the data.  (Or MOVE over it, but that's only marginally faster,
and is probably a dead loss if you intend to FETCH the data anyway
later.)

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux