Re: split builtins.h to quote.h

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Noah Misch <noah(at)leadboat(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: split builtins.h to quote.h
Date: 2014-10-13 14:14:02
Message-ID: CA+TgmoaOCoXxgL1hsv52sBw1V4g785qZwHcfQu9D_ehRsf2ovQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 13, 2014 at 9:24 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> That's a 2/2 tie then AFAIK: Noah and Stephen express concerns about
> the breakage, you and I would be fine with a clear breakage to make
> code more organized (correct me if you don't feel this way).

Well, I think that the long-standing agglomeration of prototypes from
many header files into builtins.h is kind of a wart. But I also think
that it's a justified wart, to the extent that we wish to avoid
creating many header files with only a tiny handful of prototypes. So
I'm not in a tremendous hurry to change it, but I'm OK with changing
it if other people feel there's a benefit. The main reason to
separate out quote.h, AIUI, is that unlike a lot of the stuff in
builtins.h, those functions are actually called from quite a few
places.

>> What I find strange about the actual patch is that it moves some but
>> not all of the prototypes for the stuff that ends up in quote.c into
>> quote.h. That doesn't seem right.
> Are you referring to the Datum quote_*(PG_FUNCTION_ARGS) that are
> still let in builtins.h? That was let on purpose to let all the SQL
> functions within builtins.h but I'd be happy to move everything to
> quote.h to make the separation clearer.

IMHO, putting some prototypes for a .c file in one header and others
in another header is going to make it significantly harder to figure
out which files you need to #include when. Keeping a simple rule there
seems essential to me.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2014-10-13 14:14:28 Re: JsonbValue to Jsonb conversion
Previous Message Tom Lane 2014-10-13 14:11:00 Re: split builtins.h to quote.h