Tom Lane wrote:
> Perhaps a better idea would be to put the opaque-pointer typedefs into
> heapam.h and genam.h respectively, and then see where you could remove
> inclusions of relscan.h.
Hmm, this seems to be closely equivalent. Patch attached. I also moved
SysScanDescData from genam.h to relscan.h.
> Also, it seemed like some of those .c files had no business poking into
> the scan structs anyway; particularly contrib. Did you check whether
> the inclusions could be avoided?
Not really, unless we were to provide something a routine that returns
the current block of a scan. There are a few occurrences of this:
/* must hold a buffer lock to call HeapTupleSatisfiesUpdate */
LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE);
which of course need the definition. Maybe providing it is not a bad
idea, because that kind of coding is used in the backend too.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support