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 1pkyPG-0002vr-Ov for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Apr 2023 02:34:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pkyPF-00063s-K2 for pgsql-hackers@arkaria.postgresql.org; Sat, 08 Apr 2023 02:34:21 +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 1pkyPF-00063i-A8 for pgsql-hackers@lists.postgresql.org; Sat, 08 Apr 2023 02:34:21 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pkyPC-001Ya4-Dy for pgsql-hackers@postgresql.org; Sat, 08 Apr 2023 02:34:20 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1pkyP2-007jdv-BN; Fri, 07 Apr 2023 22:34:08 -0400 Date: Fri, 7 Apr 2023 22:34:08 -0400 From: Bruce Momjian To: Tom Lane Cc: "Fujii.Yuki@df.MitsubishiElectric.co.jp" , Andres Freund , Alexander Pyhalov , Tomas Vondra , PostgreSQL-development , Julien Rouhaud , Daniel Gustafsson , Ilya Gladyshev Subject: Re: Partial aggregates pushdown Message-ID: References: <20221207185943.g3pkqseovvrk2n2e@awork3.anarazel.de> <3278991.1680918900@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3278991.1680918900@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Apr 7, 2023 at 09:55:00PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > What I don't want is an error-prone setup where administrators have to > > remember what the per-server settings are. Based on your suggestion, > > let's allow CREATE SERVER to have an option 'enable_async_aggregate' (is > > that the right name?), which defaults to 'true' for _all_ servers, even > > those that don't support async aggregates. > > Uh, what? Why would we not be able to tell from the remote server's > version number whether it has this ability? That was covered here: https://www.postgresql.org/message-id/ZC95C0%2BPVhVP3iax%40momjian.us I think we have three possible cases for aggregate pushdown to FDWs: 1) Postgres built-in aggregate functions 2) Postgres user-defined & extension aggregate functions 3) aggregate functions calls to non-PG FDWs Your patch handles #1 by checking that the FDW Postgres version is the --> same as the calling Postgres version. However, it doesn't check for --> extension versions, and frankly, I don't see how we could implement that --> cleanly without significant complexity. The issue is not a mismatch of postgres_fdw versions but the extension versions and whether the partial aggregate functions exist on the remote side, e.g., something like a PostGIS upgrade. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Embrace your flaws. They make you human, rather than perfect, which you will never be.