Re: Fix pg_dump dependency on postgres.h

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема Re: Fix pg_dump dependency on postgres.h
Дата
Msg-id 4730A7C2.5030702@sun.com
обсуждение исходный текст
Ответ на Re: Fix pg_dump dependency on postgres.h  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Fix pg_dump dependency on postgres.h  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-patches
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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Fix pg_dump dependency on postgres.h
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Fix pg_dump dependency on postgres.h