Re: [HACKERS] interface libpq Makefile.in patch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] interface libpq Makefile.in patch
Date
Msg-id 22143.918776542@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] interface libpq Makefile.in patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>> The following patch is needed to compile the current development tree
>> with perl support.  The addition of MemoryContextAlloc,
>> MemoryContextFree, and MemoryContexRealloc in
>> ./src/include/utils/palloc.h require these additional header files.

> Something wrong here ... palloc should not be visible outside the
> backend.

I have fixed the immediate symptom of the problem by making the Perl5
module not require libpq-int.h, which is better programming practice
anyway.

However, it is true that including libpq-int.h now requires access
to backend include files that are not currently being installed into
/usr/local/pgsql/include.  Thus, compiling an outside application
that uses libpq-int.h will presently fail.

I had intended all along to someday stop exporting libpq-int.h, but I
didn't really want to break code dependent on it this soon :-(.
In any case, I think that the very same problem will occur for backend
extension code (SPI) compiled outside the Postgres source tree --- the
real problem is that "postgres.h" can't be included from the install
tree anymore.

I think we have two reasonable alternatives:

(1) Install a bunch more backend-internals header files, along the lines
of Ryan's proposed patch.  Evidently we
needinclude/utils/mcxt.hinclude/nodes/memnodes.hinclude/nodes/nodes.hinclude/lib/fstack.hinclude/utils/memutils.h
and possibly other stuff.

(2) Try to clean up the palloc macros so that they don't need quite as
many random include files to be available.  (Jan?  Any chance of
reducing the tonnage a little?)


BTW, it'd really be a good idea to stop using libpq's makefile as the
place where backend header files are installed...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jackson, DeJuan"
Date:
Subject: RE: [HACKERS] Temp tables
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Temp tables