Re: relscan.h split

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: relscan.h split
Date: 2008-06-14 23:49:01
Message-ID: 20080614234901.GG8519@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
relscan-remove.patch text/x-diff 24.1 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-06-15 00:48:51 Re: relscan.h split
Previous Message Alvaro Herrera 2008-06-14 21:29:42 Re: Simplify formatting.c