pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Generate fmgr prototypes automatically
Date: Tue, 17 Jan 2017 15:07:48 -0500
Message-ID: <3211.1484683668@sss.pgh.pa.us> (raw)
In-Reply-To: <40b53c62-4cf6-2d79-4aaa-c76a76532caa@2ndquadrant.com>
References: <E1cTZ5U-00037Y-95@gemulon.postgresql.org>
	<1771.1484681728@sss.pgh.pa.us>
	<40b53c62-4cf6-2d79-4aaa-c76a76532caa@2ndquadrant.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 1/17/17 2:35 PM, Tom Lane wrote:
>> BTW, now that I've looked through this patch ... why does it add
>> 
>> +#include "nodes/nodes.h"
>> +#include "nodes/pg_list.h"
>> 
>> to utils/builtins.h?

> There are things in builtins.h that technically need those declarations.
>  It seems to work without it now, but at some point during the
> refactoring they were necessary.  I can remove them again.

[ looks around ... ]  Hm, it looks like the reason it works without
them is that utils/sortsupport.h pulls in relcache.h, which pulls in a
veritable buttload of stuff; those two and a whole lot more beside.

That seems like a pretty bad idea.  It's surely not the fault of this
patch that the sortsupport patch didn't give a damn about inclusion
footprints; but I still think we'd be well advised to minimize
builtins.h's footprint now that it's going to need to be included very
far and wide.

It looks like we could get rid of the need for sortsupport.h in
builtins.h via the good old "struct foo" forward reference trick,
that is

struct SortSupportData;

extern void varstr_sortsupport(struct SortSupportData *ssup, Oid collid, bool bpchar);

but I wonder if that's going far enough.  We'd still be propagating
pg_list.h into a lot of places that don't necessarily need it.

Alternatively ... is there a specific reason why you chose to make
builtins.h the key inclusion file for this change, rather than having
callers include fmgrprotos.h directly?  It seems like the stuff remaining
in builtins.h is just a laundry list of random utility functions.
Maybe dispersing those to other headers is the thing to do.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (13+ messages)  latest in thread

Message-ID: <3211.1484683668@sss.pgh.pa.us>
Permalink:  ../3211.1484683668@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3211.1484683668@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com
  Subject: Re: pgsql: Generate fmgr prototypes automatically
  In-Reply-To: <3211.1484683668@sss.pgh.pa.us>
  References: <E1cTZ5U-00037Y-95@gemulon.postgresql.org> <1771.1484681728@sss.pgh.pa.us> <40b53c62-4cf6-2d79-4aaa-c76a76532caa@2ndquadrant.com> <3211.1484683668@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox