Re: Fix pg_dump dependency on postgres.h

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Fix pg_dump dependency on postgres.h
Date: 2007-11-14 14:33:03
Message-ID: 20071114143303.GQ19014@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Zdenek Kotala wrote:
> Zdenek Kotala 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
>>>
>> I found two problems there. One is that I forgot postgres.h include in
>> common.c. it is easy to fix. However second problem is more complicated.
>> dumputils.c calls ScandKeywordLookup function which is defined in
>> keyword.c. :(
>
> <snip>
>
>> 3) Put following fake into keyword.c before include "parse.h" line. It is
>> easiest way.
>> #define TYPE_IS_DECLARED 1
>> #define YYLTYPE_IS_DECLARED 1
>> #define YYLTYPE void*
>> #define YYSTYPE void*
>
> New version of patch is attached. I selected variant 3 as a best solution.
> Patch also fix some other postgres.h dependencyin another tools such as
> pg_controldata, pg_config. The last unfixed tool is pg_resetxlog which
> deserves own patch.

Humm, but YYLTYPE is defined in gramparse.h (and as a different type)
... Also, I see that if you define YYLTYPE then you don't need
YYLTYPE_IS_DECLARED as well. Also I don't see any TYPE_IS_DECLARED
here. What I'm thinking is that this patch is not very portable :-(

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Llegará una época en la que una investigación diligente y prolongada sacará
a la luz cosas que hoy están ocultas" (Séneca, siglo I)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-11-14 15:00:19 Re: Spinlock backoff algorithm
Previous Message Zdenek Kotala 2007-11-14 14:14:45 Re: Fix pg_dump dependency on postgres.h

Browse pgsql-patches by date

  From Date Subject
Next Message Zdenek Kotala 2007-11-14 15:13:19 Re: Fix pg_dump dependency on postgres.h
Previous Message Zdenek Kotala 2007-11-14 14:14:45 Re: Fix pg_dump dependency on postgres.h