Re: relscan.h split - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: relscan.h split
Date
Msg-id 20080614234901.GG8519@alvh.no-ip.org
Whole thread Raw
In response to Re: relscan.h split  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: relscan.h split  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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

Attachment

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Simplify formatting.c
Next
From: Tom Lane
Date:
Subject: Re: relscan.h split