Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> How do I find the number of pages from heapscan?
IIRC, heap_beginscan updates the relcache entry with the current number
of blocks (as determined the hard way, with lseek). Should be able to
use that, even though it might be a little bit out of date by the time
you finish the scan ...
regards, tom lane