From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Proposed refactoring of planner header files
Date: Mon, 28 Jan 2019 16:35:49 -0500
Message-ID: <15666.1548711349@sss.pgh.pa.us> (raw)
In-Reply-To: <20190128210211.4is52ckj2voz2bdl@alap3.anarazel.de>
References: <11460.1548706639@sss.pgh.pa.us>
<20190128203229.yreabsq6kinxdnh5@alap3.anarazel.de>
<13179.1548708622@sss.pgh.pa.us>
<20190128210211.4is52ckj2voz2bdl@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> On 2019-01-28 15:50:22 -0500, Tom Lane wrote:
>> Andres Freund <andres@anarazel.de> writes:
>>> Ugh, isn't it nicer to just use the underlying struct type instead of
>>> that?
>> No, because that'd mean that anyplace relying on optimizer.h would also
>> have to write "struct PlannerInfo" rather than "PlannerInfo"; the
>> effects wouldn't be limited to the header itself.
> Why? It can be called with the typedef'd version, or not.
Because I don't want users of the header to have to declare, say, local
variables as "struct PlannerInfo *root" instead of "PlannerInfo *root".
The former is not project style and I will not accept forcing that in
order to save a couple of #ifdefs in headers. I don't actually understand
what you find so ugly about it.
One idea that would save a lot of random "struct foo" hacks in headers
is to allow nodes.h to include "typedef struct MyNode MyNode" for any
recognized node type. We could either do that just for nodes we've
found it useful for, or pre-emptively for the whole list.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
Subject: Re: Proposed refactoring of planner header files
In-Reply-To: <15666.1548711349@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