pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgindent vs dtrace on macos
Date: Mon, 21 Sep 2020 14:55:37 -0400
Message-ID: <1019914.1600714537@sss.pgh.pa.us> (raw)
In-Reply-To: <66137.1600303192@sss.pgh.pa.us>
References: <20200917000334.GA28142@alvherre.pgsql>
	<66137.1600303192@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

Attachments:

rename-C-functions-to-avoid-pgindent-funnies.patch (text/x-diff, 2.0K) download diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.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 = PG_GETARG_NUMERIC(0); int32 typmod = 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 = 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 => 'ascii' }, { oid => '1621', descr => 'convert int4 to char', proname => 'chr', prorettype => 'text', proargtypes => 'int4', - prosrc => 'chr' }, + prosrc => 'chr_code_to_text' }, { oid => '1622', descr => 'replicate string n times', proname => 'repeat', prorettype => 'text', proargtypes => 'text int4', prosrc => 'repeat' }, @@ -4210,7 +4210,8 @@ proargtypes => 'internal', prosrc => 'numeric_support' }, { oid => '1703', descr => 'adjust numeric to typmod precision/scale', proname => 'numeric', prosupport => 'numeric_support', - prorettype => 'numeric', proargtypes => 'numeric int4', prosrc => 'numeric' }, + prorettype => 'numeric', proargtypes => 'numeric int4', + prosrc => 'numeric_apply_typmod' }, { oid => '1704', proname => 'numeric_abs', prorettype => 'numeric', proargtypes => 'numeric', prosrc => 'numeric_abs' },

view thread (21+ messages)  latest in thread

Message-ID: <1019914.1600714537@sss.pgh.pa.us>
Permalink:  ../1019914.1600714537@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1019914.1600714537@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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@yesql.se, alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com
  Subject: Re: pgindent vs dtrace on macos
  In-Reply-To: <1019914.1600714537@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