Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKQyc-00030x-BL for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Sep 2020 18:55:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kKQyY-0002QN-O4 for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Sep 2020 18:55:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKQyY-0002QG-HH for pgsql-hackers@lists.postgresql.org; Mon, 21 Sep 2020 18:55:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKQyR-00084W-Uf for pgsql-hackers@postgresql.org; Mon, 21 Sep 2020 18:55:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08LItbf41019915; Mon, 21 Sep 2020 14:55:37 -0400 From: Tom Lane To: Daniel Gustafsson cc: Alvaro Herrera , Peter Eisentraut , pgsql-hackers Subject: Re: pgindent vs dtrace on macos In-reply-to: <66137.1600303192@sss.pgh.pa.us> References: <20200917000334.GA28142@alvherre.pgsql> <66137.1600303192@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 16 Sep 2020 20:39:52 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1019888.1600714514.0@sss.pgh.pa.us> Date: Mon, 21 Sep 2020 14:55:37 -0400 Message-ID: <1019914.1600714537@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1019888.1600714514.1@sss.pgh.pa.us> Oh wait, I forgot about the fmgrprotos.h discrepancy. I wrote: > It strikes me that a low-cost workaround would be to rename these > C functions. There's no law that their C names must match the > SQL names. Here's a proposed patch to fix it that way. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="rename-C-functions-to-avoid-pgindent-funnies.patch"; charset="us-ascii" Content-ID: <1019888.1600714514.2@sss.pgh.pa.us> Content-Description: rename-C-functions-to-avoid-pgindent-funnies.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numer= ic.c index 27d65557df..2cc2da60eb 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -1109,7 +1109,7 @@ numeric_support(PG_FUNCTION_ARGS) * scale of the attribute have to be applied on the value. */ Datum -numeric (PG_FUNCTION_ARGS) +numeric_apply_typmod(PG_FUNCTION_ARGS) { Numeric num =3D PG_GETARG_NUMERIC(0); int32 typmod =3D PG_GETARG_INT32(1); diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt= /oracle_compat.c index 76e666474e..79ba28671f 100644 --- a/src/backend/utils/adt/oracle_compat.c +++ b/src/backend/utils/adt/oracle_compat.c @@ -923,7 +923,7 @@ ascii(PG_FUNCTION_ARGS) ********************************************************************/ = Datum -chr (PG_FUNCTION_ARGS) +chr_code_to_text(PG_FUNCTION_ARGS) { uint32 cvalue =3D PG_GETARG_UINT32(0); text *result; diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc= .dat index f48f5fb4d9..5eb293ee8f 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -3399,7 +3399,7 @@ prosrc =3D> 'ascii' }, { oid =3D> '1621', descr =3D> 'convert int4 to char', proname =3D> 'chr', prorettype =3D> 'text', proargtypes =3D> 'int4', - prosrc =3D> 'chr' }, + prosrc =3D> 'chr_code_to_text' }, { oid =3D> '1622', descr =3D> 'replicate string n times', proname =3D> 'repeat', prorettype =3D> 'text', proargtypes =3D> 'text i= nt4', prosrc =3D> 'repeat' }, @@ -4210,7 +4210,8 @@ proargtypes =3D> 'internal', prosrc =3D> 'numeric_support' }, { oid =3D> '1703', descr =3D> 'adjust numeric to typmod precision/scale', proname =3D> 'numeric', prosupport =3D> 'numeric_support', - prorettype =3D> 'numeric', proargtypes =3D> 'numeric int4', prosrc =3D>= 'numeric' }, + prorettype =3D> 'numeric', proargtypes =3D> 'numeric int4', + prosrc =3D> 'numeric_apply_typmod' }, { oid =3D> '1704', proname =3D> 'numeric_abs', prorettype =3D> 'numeric', proargtypes =3D>= 'numeric', prosrc =3D> 'numeric_abs' }, ------- =_aaaaaaaaaa0--