generating fmgr prototypes automatically

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: generating fmgr prototypes automatically
Date: 2016-12-31 05:46:33
Message-ID: 98089934-6024-6d54-5ed9-c875f064835c@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

During some recent patch reviews, there was some back and forth about
where to put prototypes for fmgr-callable functions. We don't actually
need these prototypes except to satisfy the compiler, so we end up
sprinkling them around random header files.

I figured we could generate these prototypes automatically using the
existing Gen_fmgrtab.pl script. That ends up saving more than 2000
lines of manual code, and it helps detect when a function exists in code
but is not registered in pg_proc.h.

... which this actually found in cash.c. I ended up adding the missing
entries in pg_proc and pg_operator, but we could also opt to just remove
the unused code.

There are long-standing symbol clashes from the lo_* functions between
the backend and libpq. So far this hasn't bothered anyone, but because
this patch rearranges some header files, the libpqwalreceiver code gets
upset. So I renamed the C symbols for the backends functions in a
separate patch. The user-visible function names remain the same.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
0001-Remove-unnecessary-include.patch text/x-patch 1.7 KB
0002-Rename-C-symbols-for-backend-lo_-functions.patch text/x-patch 16.4 KB
0003-Register-missing-money-operators-in-system-catalogs.patch text/x-patch 3.7 KB
0004-Generate-fmgr-prototypes-automatically.patch text/x-patch 164.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-12-31 05:57:49 port of INSTALL file generation to XSLT
Previous Message Amit Kapila 2016-12-31 05:44:32 Group clear xid can leak semaphore count