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 1kcFr1-0003o7-MB for pgsql-committers@arkaria.postgresql.org; Mon, 09 Nov 2020 22:41:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcFr0-00022m-AM for pgsql-committers@arkaria.postgresql.org; Mon, 09 Nov 2020 22:41:38 +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 1kcFr0-00022f-52 for pgsql-committers@lists.postgresql.org; Mon, 09 Nov 2020 22:41:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcFqy-0000sM-4e for pgsql-committers@lists.postgresql.org; Mon, 09 Nov 2020 22:41:37 +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 0A9MfYdo2008196; Mon, 9 Nov 2020 17:41:34 -0500 From: Tom Lane To: Andrew Dunstan cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Declare assorted array functions using anycompatible not anyelem In-reply-to: <52030649-c25c-c4e6-8316-2fd4f9a24f8b@dunslane.net> References: <1999748.1604957386@sss.pgh.pa.us> <2001798.1604960149@sss.pgh.pa.us> <52030649-c25c-c4e6-8316-2fd4f9a24f8b@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Mon, 09 Nov 2020 17:35:18 -0500" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <2008170.1604961656.0@sss.pgh.pa.us> Date: Mon, 09 Nov 2020 17:41:34 -0500 Message-ID: <2008195.1604961694@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: <2008170.1604961656.1@sss.pgh.pa.us> Andrew Dunstan writes: > On 11/9/20 5:15 PM, Tom Lane wrote: >> Hm. To fix it this way, we'd have to push the test-script change >> into the pre-9.5 branches. There's no technical reason we can't do >> that, I don't think, though it's a bit outside our normal practices. > I doubt it's necessary. We have provision for adjusting the source > database before we try to upgrade it. Let me know exactly what you have > in mind and I'll try to make it work without having to mangle the > supposedly frozen back branches. > We don't actually run the regression suite regularly for non-live > branches, we just try to upgrade a completely static data dir. What I have in mind to apply to 9.5 through 13 is per attached. You could either redefine the aggregate similarly in 9.2-9.4, or just drop it. I doubt the latter leads to any interesting loss of coverage for xversion upgrade, as there's plenty of other user-defined aggregates in the regression database. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="xversion-fix-13.patch"; charset="us-ascii" Content-ID: <2008170.1604961656.2@sss.pgh.pa.us> Content-Description: xversion-fix-13.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress= /expected/polymorphism.out index 1ff40764d9..980e2e861c 100644 --- a/src/test/regress/expected/polymorphism.out +++ b/src/test/regress/expected/polymorphism.out @@ -729,24 +729,24 @@ select q2, sql_if(q2 > 0, q2, q2 + 1) from int8_tbl; (5 rows) = -- another sort of polymorphic aggregate -CREATE AGGREGATE array_cat_accum (anyarray) +CREATE AGGREGATE array_larger_accum (anyarray) ( - sfunc =3D array_cat, + sfunc =3D array_larger, stype =3D anyarray, initcond =3D '{}' ); -SELECT array_cat_accum(i) +SELECT array_larger_accum(i) FROM (VALUES (ARRAY[1,2]), (ARRAY[3,4])) as t(i); - array_cat_accum = ------------------ - {1,2,3,4} + array_larger_accum = +-------------------- + {3,4} (1 row) = -SELECT array_cat_accum(i) +SELECT array_larger_accum(i) FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t= (i); - array_cat_accum = ------------------------------------ - {"(1,2)","(3,4)","(5,6)","(7,8)"} + array_larger_accum = +-------------------- + {"(5,6)","(7,8)"} (1 row) = -- another kind of polymorphic aggregate diff --git a/src/test/regress/sql/polymorphism.sql b/src/test/regress/sql/= polymorphism.sql index e5222f1f81..15b8dfc6ce 100644 --- a/src/test/regress/sql/polymorphism.sql +++ b/src/test/regress/sql/polymorphism.sql @@ -498,17 +498,17 @@ select q2, sql_if(q2 > 0, q2, q2 + 1) from int8_tbl; = -- another sort of polymorphic aggregate = -CREATE AGGREGATE array_cat_accum (anyarray) +CREATE AGGREGATE array_larger_accum (anyarray) ( - sfunc =3D array_cat, + sfunc =3D array_larger, stype =3D anyarray, initcond =3D '{}' ); = -SELECT array_cat_accum(i) +SELECT array_larger_accum(i) FROM (VALUES (ARRAY[1,2]), (ARRAY[3,4])) as t(i); = -SELECT array_cat_accum(i) +SELECT array_larger_accum(i) FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t= (i); = -- another kind of polymorphic aggregate ------- =_aaaaaaaaaa0--