Re: Moving of INT64_FORMAT to c.h

From: Steve Singer <steve(at)ssinger(dot)info>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, Jan Wieck <jan(at)wi3ck(dot)info>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Moving of INT64_FORMAT to c.h
Date: 2014-10-22 20:12:06
Message-ID: BLU437-SMTP21B7356FAFAAE2FE88AC71DC950@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/16/2014 08:08 AM, Andres Freund wrote:
> On 2014-10-16 08:04:17 -0400, Jan Wieck wrote:
>> Hi,
>>
>> PostgreSQL has for ages defined INT64_FORMAT and UINT64_FORMAT in
>> pg_config.h. This commit
>>
>> http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=ce486056ecd28050
>>
>> moved those definitions to c.h, which breaks compilation of all released
>> Slony-I versions against current master. Can those be moved back to where
>> they used to be?
> Well, you could add additional configure stuff to also emit what you
> want.
>
>> Slony uses the definitions in external tools, like slon and slonik, to
>> format sequence numbers in log output.
> Then it should include c.h/postgres_fe.h?

So the header of c.h says "Note that the definitions here are not
intended to be exposed to clients"
but
postgres_fe.h says "This should be the first file included by PostgreSQL
client libraries and"

Should client programs that live outside the postgres source tree be
including postgres_fe.h ? I have a feeling the answer is no. If the
answer is no, then why does a make install install postgres_fe.h ?

Slonik used to include postgre_fe.h but back in 2011 or so we stopped
doing so because it was causing issues (I think on win32 builds)

Maybe slony client programs shouldn't be trying to steal portability
definitions from postgres headers, but I doubt we are the only ones
doing that. It isn't a big deal for slony to define it's own
INT64_FORMAT for 9.5+ but third party projects that have been including
pg_config.h will hit similar issues. if there was good reason for the
change then fine (Postgres isn't intended to be a general purpose C
portability layer).

Steve

> Greetings,
>
> Andres Freund
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-10-22 20:17:28 Re: Moving of INT64_FORMAT to c.h
Previous Message Robert Haas 2014-10-22 20:10:26 Re: delta relations in AFTER triggers