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 1nTDad-0006vP-5I for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Mar 2022 02:04:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTDaZ-0000Rk-QC for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Mar 2022 02:04:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTDaZ-0000Ra-5A for pgsql-hackers@lists.postgresql.org; Sun, 13 Mar 2022 02:04:07 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTDaS-0003tV-9p for pgsql-hackers@lists.postgresql.org; Sun, 13 Mar 2022 02:04:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sN70ObC7oraGLsazML8EKkojBWBtwGfaMG2nnTHt0m4=; b=sliTp0/tG3b2sJ90HQQNaQAiAY urnoFvhRftu2fiIJ+nOUWauuqSnRuzuZBcQM7n8cYW7ewkpZY5tCCPz2sSziZf8u8p/Vf/778S5px /wGLcEVI2VX3ZRs+MW3Xdnv+bRc5rsG8TFiivMeAm1n+7Yub6+5i4jfyh17ntqXGGK9ZBxx7DEEUs ZW0O+1bFDsdVNMM4X/Ft/M+BbwsGtdUBQWtI72hb1eGPPAJLv0SM0NagGy5c2bMzKhHYy8siswVyG 0NEkvyg70cSAUV4lsAV6bV6uENtWIDCrqtmeNfYkotFuJrdrW0P0ioXeSi3UYWLrhf2Y2XEcZv8S5 PtQ3Alwg==; Received: from [184.19.43.81] (port=51909) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nTDaQ-00AYWe-4u; Sat, 12 Mar 2022 21:03:58 -0500 Subject: Re: range_agg with multirange inputs To: Paul Jungwirth , pgsql-hackers@lists.postgresql.org References: <007ef255-35ef-fd26-679c-f97e7a7f30c2@illuminatedcomputing.com> <007ef255-35ef-fd26-679c-f97e7a7f30c2@illuminatedcomputing.com> <164592443404.882.11296254043197567171.pgcf@coridan.postgresql.org> <6556b959-f839-aee2-4b4b-0b5107c0db11@illuminatedcomputing.com> <621E912C.3020307@anastigmatix.net> <42454377-d914-0e22-37da-1b63ce3b9f9d@illuminatedcomputing.com> <622A7690.4020800@anastigmatix.net> <71eabe81-3e69-0476-347a-c8342de5cd41@illuminatedcomputing.com> From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <622D510C.6030100@anastigmatix.net> Date: Sat, 12 Mar 2022 21:03:56 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <71eabe81-3e69-0476-347a-c8342de5cd41@illuminatedcomputing.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 03/11/22 22:18, Paul Jungwirth wrote: > Arg, fixed. > >> In range_agg_transfn, you've changed the message in the "must be called >> with a range or multirange"; that seems like another good candidate to >> be an elog. > > Agreed. Updated here. This looks good to me and passes installcheck-world, so I'll push the RfC button. > Sharing a prosrc seems even less remarkable than sharing an aggfinalfn. > You're right there are no cases for other finalfns yet, but I don't think > there is anything special about finalfns that would make this a weirder > thing to do there than with ordinary functions. You sent me back to look at how many of those there are. I get 42 cases of shared prosrc (43 now). The chief subgroup of those looks to involve sharing between parameter signatures where the types have identical layouts and the semantic differences are unimportant to the function in question (comparisons between bit or between varbit, overlaps taking timestamp or timestamptz, etc.). The other prominent group is range and multirange constructors, where the C function has an obviously generic name like range_constructor2 and gets shared by a bunch of SQL declarations. I think here we've added the first instance where the C function is shared by SQL-declared functions accepting two different polymorphic pseudotypes. But it's clearly simple and works, nothing objectionable about it. I had experimented with renaming multirange_agg_finalfn to just range_agg_finalfn so it would just look like two overloads of one function sharing a prosrc, and ultimately gave up because genbki.pl couldn't resolve the OID where the name is used in pg_aggregate.dat. That's why it surprised me to see three instances where other functions (overlaps, isfinite, name) do use the same SQL name for different overloads, but the explanation seems to be that nothing else at genbki time refers to those, so genbki's unique-name limitation doesn't affect them. Neither here nor there for this patch, but an interesting new thing I learned while reviewing it. Regards, -Chap