Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMB2L-001a4U-ES for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 17:32:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qMB2J-008SCW-ME for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 17:32:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMB2I-008SC7-Oh for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 17:32:27 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMB2F-000Lq5-Bg for pgsql-hackers@postgresql.org; Wed, 19 Jul 2023 17:32:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 0A3AB320090A; Wed, 19 Jul 2023 13:32:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 19 Jul 2023 13:32:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1689787940; x=1689874340; bh=ta 3CJrm2Cvhh2LpbJT0KVPOaYoV5YSVV6amGaksl5DU=; b=Z631nVZNr+FSe+dZ4l lPxsAGJWyeHKbUJJnkOjY0CKjkQGVMLtzo6SVsKoZxt+cSTsosnSKDMY76cpejol BK7HLoxfGQMWNen30q2GS5ebyAWHsuBsDEOvkbw1PNH84xewMh3GTVJT5rEQSXOw 4cowgU0Ykg/dP8mQqffUcLGaYgemmjRHAHkw4R0HTS4h0uehoK1Pe8oRxbc8MSEr SOgwFRmdZrJaL0DBzipRhup1sdgRbBxN0nr7R/VifyEAaOFIrWiuMbj4LNzTFPH+ p5QYebMI6T7r5s0tW3CPsC1BsXfSrqQ1MmgjLW3cffTB89aghzznVrHPXyFeyCBE bOPQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689787940; x=1689874340; bh=ta3CJrm2Cvhh2 LpbJT0KVPOaYoV5YSVV6amGaksl5DU=; b=F0Jq3gZvlbfmu+WxWa12gXxaiBXjR /gYkYvprc7QklM9lj1Yd0rSfx5QSjziTY+tcuSLGuEyiZU8w8EaUO/H0UZaEs3mq s92sLMdXzsmVLqBmntvCswrsxopGo2Hd8ffmd35rYPMdCS6Ko/64qlMxhQ3Dnr5p /YTUo4CWcYoDXKgjIrSthhPDbppz1hRQPq6Y45egarczLhz7Tj/ul7Q8c1BguLFu 7mKV4zku3rADSc2DRkJ1e39CVrt0QdwglUuM5jJRG+2DDCVeVrdDytKfiuc9fqID LKdoWLBU52BI8hcgehrjDAjxzn08yg53MNinKnL2lnkVp0qVqYfVOL4uQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeekgdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufhfffgjkfgfgggtsehmtderredtreejnecuhfhrohhmpeffrghgfhhi nhhnucfklhhmrghrihcuofgrnhhnshonkhgvrhcuoehilhhmrghrihesihhlmhgrrhhird horhhgqeenucggtffrrghtthgvrhhnpedvvdfhhedtfeekudfgtedufeehgffggeejieej heeugfethefggedtleegteetjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehilhhmrghrihesihhlmhgrrhhirdhorhhg X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jul 2023 13:32:18 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Daniel Gustafsson Cc: Jim Jones , PostgreSQL Hackers Subject: Re: Adding argument names to aggregate functions References: <877cw3jl8y.fsf@wibble.ilmari.org> <87wn2hq959.fsf@wibble.ilmari.org> <16f35a27-ad65-0420-44ee-b41c3fd08aee@uni-muenster.de> <87mt3ardbc.fsf@wibble.ilmari.org> <54d1c9a9-6b16-2fb2-199e-ac903c88c4d2@uni-muenster.de> <87sfcxv61h.fsf@wibble.ilmari.org> Date: Wed, 19 Jul 2023 18:32:16 +0100 In-Reply-To: (Daniel Gustafsson's message of "Wed, 19 Jul 2023 09:56:29 +0200") Message-ID: <87zg3rq02n.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Daniel Gustafsson writes: > This patch no longer applied but had a fairly trivial conflict so I've attached > a rebased v3 addressing the conflict in the hopes of getting this further. Thanks for the heads-up! Turns out the conflict was due to the new json(b)_object_agg(_unique)(_strict) functions, which should also have proargnames added. Here's an updated patch that does that. - ilmari --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v4-0001-Add-argument-names-to-multi-argument-aggregates.patch From 2da3bada4f2a9425cbaa925a51f78773e4e16dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Mon, 27 Feb 2023 13:06:29 +0000 Subject: [PATCH v4] Add argument names to multi-argument aggregates This makes it easier to see which way around the arguments go when using \dfa. This is particularly relevant for string_agg(), but add it to json(b)_object_agg() too for good measure. --- src/include/catalog/pg_proc.dat | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 6996073989..3e283671dc 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -4992,7 +4992,7 @@ { oid => '3538', descr => 'concatenate aggregate input into a string', proname => 'string_agg', prokind => 'a', proisstrict => 'f', prorettype => 'text', proargtypes => 'text text', - prosrc => 'aggregate_dummy' }, + proargnames => '{value,delimiter}', prosrc => 'aggregate_dummy' }, { oid => '3543', descr => 'aggregate transition function', proname => 'bytea_string_agg_transfn', proisstrict => 'f', prorettype => 'internal', proargtypes => 'internal bytea bytea', @@ -5004,7 +5004,7 @@ { oid => '3545', descr => 'concatenate aggregate input into a bytea', proname => 'string_agg', prokind => 'a', proisstrict => 'f', prorettype => 'bytea', proargtypes => 'bytea bytea', - prosrc => 'aggregate_dummy' }, + proargnames => '{value,delimiter}', prosrc => 'aggregate_dummy' }, # To ASCII conversion { oid => '1845', descr => 'encode text from DB encoding to ASCII text', @@ -8953,21 +8953,22 @@ { oid => '3197', descr => 'aggregate input into a json object', proname => 'json_object_agg', prokind => 'a', proisstrict => 'f', provolatile => 's', prorettype => 'json', proargtypes => 'any any', - prosrc => 'aggregate_dummy' }, + proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '6280', descr => 'aggregate non-NULL input into a json object', proname => 'json_object_agg_strict', prokind => 'a', proisstrict => 'f', provolatile => 's', prorettype => 'json', proargtypes => 'any any', - prosrc => 'aggregate_dummy' }, + proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '6281', descr => 'aggregate input into a json object with unique keys', proname => 'json_object_agg_unique', prokind => 'a', proisstrict => 'f', provolatile => 's', prorettype => 'json', proargtypes => 'any any', - prosrc => 'aggregate_dummy' }, + proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '6282', descr => 'aggregate non-NULL input into a json object with unique keys', proname => 'json_object_agg_unique_strict', prokind => 'a', proisstrict => 'f', provolatile => 's', prorettype => 'json', - proargtypes => 'any any', prosrc => 'aggregate_dummy' }, + proargtypes => 'any any', proargnames => '{key,value}', + prosrc => 'aggregate_dummy' }, { oid => '3198', descr => 'build a json array from any inputs', proname => 'json_build_array', provariadic => 'any', proisstrict => 'f', provolatile => 's', prorettype => 'json', proargtypes => 'any', @@ -9881,22 +9882,22 @@ prosrc => 'jsonb_object_agg_finalfn' }, { oid => '3270', descr => 'aggregate inputs into jsonb object', proname => 'jsonb_object_agg', prokind => 'a', proisstrict => 'f', - prorettype => 'jsonb', proargtypes => 'any any', + prorettype => 'jsonb', proargtypes => 'any any', proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '6288', descr => 'aggregate non-NULL inputs into jsonb object', proname => 'jsonb_object_agg_strict', prokind => 'a', proisstrict => 'f', - prorettype => 'jsonb', proargtypes => 'any any', + prorettype => 'jsonb', proargtypes => 'any any', proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '6289', descr => 'aggregate inputs into jsonb object checking key uniqueness', proname => 'jsonb_object_agg_unique', prokind => 'a', proisstrict => 'f', - prorettype => 'jsonb', proargtypes => 'any any', + prorettype => 'jsonb', proargtypes => 'any any', proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '6290', descr => 'aggregate non-NULL inputs into jsonb object checking key uniqueness', proname => 'jsonb_object_agg_unique_strict', prokind => 'a', proisstrict => 'f', prorettype => 'jsonb', proargtypes => 'any any', - prosrc => 'aggregate_dummy' }, + proargnames => '{key,value}', prosrc => 'aggregate_dummy' }, { oid => '3271', descr => 'build a jsonb array from any inputs', proname => 'jsonb_build_array', provariadic => 'any', proisstrict => 'f', provolatile => 's', prorettype => 'jsonb', proargtypes => 'any', -- 2.39.2 --=-=-=--