Alvaro Herrera wrote:
> Zdenek Kotala wrote:
>> Attached patch removes pg_dump dependency on postgres.h. The main reason
>> for that was discussed there:
>>
>> http://archives.postgresql.org/pgsql-hackers/2007-10/msg01261.php
>>
>> This fix contains several steps:
>>
>> 1) I removed sugar word from postgres.h and put them closer to consumer
>> :-). I created include/catalog/genbki.h which contains sugar words - macros
>> for correct catalog data processing. All catalogs file now include this
>> header.
>
> What's the point of this? I don't see what difference it makes from the
> current situation. In particular I don't see it being included in any
> new place.
The problem is that postgres.h include palloc.h which contains extern
declaration of MemoryContext global variable. It is not correct for
tools as pg_dump is. Because it does not use palloc. When I enabled
inline functions and start compiling postgres with sunstudio, linking
phase failed on pg_dump because MemoryContext is not allocated. It is
background of problem.
pg_dump.c needs some macros which are defined into catalogs header. But
it should not include postgres.h where is defined "sugar words" for
catalog data. It is the reason why I moved these macros to the separate
header and include this header from all catalog header.
It was discussed there:
http://archives.postgresql.org/pgsql-hackers/2007-10/msg01277.php
Zdenek