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 1kbuP9-0001j8-Ud for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Nov 2020 23:47:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kbuP8-0003xN-FE for pgsql-hackers@arkaria.postgresql.org; Sun, 08 Nov 2020 23:47:26 +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 1kbuP8-0003xG-8D for pgsql-hackers@lists.postgresql.org; Sun, 08 Nov 2020 23:47:26 +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 1kbuP5-0006eT-Ua for pgsql-hackers@lists.postgresql.org; Sun, 08 Nov 2020 23:47:25 +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 0A8NlMbe1915574; Sun, 8 Nov 2020 18:47:22 -0500 From: Tom Lane To: Andrew Dunstan cc: pgsql-hackers@lists.postgresql.org Subject: Re: array_cat anycompatible change is breaking xversion upgrade tests In-reply-to: <1401824.1604537031@sss.pgh.pa.us> References: <1401824.1604537031@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 04 Nov 2020 19:43:51 -0500" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1915527.1604879173.0@sss.pgh.pa.us> Date: Sun, 08 Nov 2020 18:47:22 -0500 Message-ID: <1915573.1604879242@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: <1915527.1604879173.1@sss.pgh.pa.us> I wrote: > I think the most plausible response is to add this aggregate to the filter > logic that already exists in the xversion tests. Perhaps we could > alternatively change this test case so that it relies on some other > polymorphic function, but I'm not quite sure what a good candidate > would be. After looking at the commit that added array_cat_accum() (65d9aedb1), I decided that it's fine to replace this aggregate with one using another anyarray function, such as array_larger(). The point of that test is just to show that the array argument can be array-of-record, so we don't need the operation to be array_cat() specifically. So I propose the attached patches to un-break the xversion tests. I'll hold off pushing this till after this week's wraps, though. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="xversion-fix-head.patch"; charset="us-ascii" Content-ID: <1915527.1604879173.2@sss.pgh.pa.us> Content-Description: xversion-fix-head.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress= /expected/polymorphism.out index 2c3bb0a60b..b33b004a7f 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 (anycompatiblearray) +CREATE AGGREGATE array_larger_accum (anyarray) ( - sfunc =3D array_cat, - stype =3D anycompatiblearray, + 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 70a21c8978..527899e8ad 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 (anycompatiblearray) +CREATE AGGREGATE array_larger_accum (anyarray) ( - sfunc =3D array_cat, - stype =3D anycompatiblearray, + 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 Content-Type: text/x-diff; name="xversion-fix-back.patch"; charset="us-ascii" Content-ID: <1915527.1604879173.3@sss.pgh.pa.us> Content-Description: xversion-fix-back.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--