pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rethink the generation rule for fmgroids.h macros.
Date: Mon, 02 Nov 2020 16:57:36 +0000
Message-ID: <E1kZd9E-0004fU-PO@gemulon.postgresql.org> (raw)

Rethink the generation rule for fmgroids.h macros.

Traditionally, the names of fmgroids.h macros for pg_proc OIDs
have been constructed from the prosrc field.  But sometimes the
same C function underlies multiple pg_proc entries, forcing us
to make an arbitrary choice of which OID to reference; the other
entries are then not namable via fmgroids.h.  Moreover, we could
not have macros at all for pg_proc entries that aren't for
C-coded functions.

Instead, use the proname field, and append the proargtypes field
(replacing inter-argument spaces with underscores) if proname is
not unique.  Special-casing unique entries such as F_OIDEQ removes
the need to change a lot of code.  Indeed, I can only find two
places in the tree that need to be adjusted; while this changes
quite a few existing entries in fmgroids.h, few of them are
referenced from C code.

With this patch, all entries in pg_proc.dat have macros in fmgroids.h.

Discussion: https://postgr.es/m/472274.1604258384@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8e1f37c07aafd4bb7aa6e1e1982010af11f8b5c7

Modified Files
--------------
src/backend/optimizer/util/clauses.c |  2 +-
src/backend/utils/Gen_fmgrtab.pl     | 51 ++++++++++++++++++------------------
src/backend/utils/adt/ruleutils.c    |  2 +-
3 files changed, 28 insertions(+), 27 deletions(-)



Message-ID: <E1kZd9E-0004fU-PO@gemulon.postgresql.org>
Permalink:  ../E1kZd9E-0004fU-PO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kZd9E-0004fU-PO@gemulon.postgresql.org

 · 

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
  Subject: Re: pgsql: Rethink the generation rule for fmgroids.h macros.
  In-Reply-To: <E1kZd9E-0004fU-PO@gemulon.postgresql.org>
  References: <E1kZd9E-0004fU-PO@gemulon.postgresql.org>

* 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