Limit usage of tcop/dest.h - Mailing list pgsql-patches

From Alvaro Herrera
Subject Limit usage of tcop/dest.h
Date
Msg-id 20051102135007.GC26524@surnet.cl
Whole thread Raw
Responses Re: Limit usage of tcop/dest.h  ("Andrew Dunstan" <andrew@dunslane.net>)
Re: Limit usage of tcop/dest.h  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Hi,

I just found out that tcop/dest.h is included in executor/spi.h, and it
contains many things that aren't needed for compiling SPI programs/
libraries.  By way of example I compiled the whole of contrib with the
attached patch and it works fine.  Notice that the only thing I'm doing
is taking the forward declaration of Portal into a separate file,
portalforw.h -- that's the only definition that's really needed by SPI
programs.  (It also allows PL/php to compile without having to patch PHP
nor PostgreSQL sources).

Note that since tcop/dest.h now includes portalforw.h, anybody who
currently needs the Portal definition is still getting it.  The only
thing I'm doing is un-export the rest of tcop/dest.h from
executor/spi.h.

So instead of changing the names of the CommandDest enum, I'm hiding it
from external view.

Note that executor/spi.h does not follow the convention that #includes
should be alphabetically ordered.  I did not change that in this patch
in order to show that this change is really minimal.

Does anybody object to committing this patch to current CVS HEAD?
(Comments about a better position/name for the new file are welcome.)

--
Alvaro Herrera                 http://www.amazon.com/gp/registry/DXLWNGRJD34J
"The only difference is that Saddam would kill you on private, where the
Americans will kill you in public" (Mohammad Saleh, 39, a building contractor)

Attachment

pgsql-patches by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: tsearch2 makefile fixes
Next
From: Alvaro Herrera
Date:
Subject: Re: tsearch2 makefile fixes