From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: array_cat anycompatible change is breaking xversion upgrade tests
Date: Sun, 08 Nov 2020 18:47:22 -0500
Message-ID: <1915573.1604879242@sss.pgh.pa.us> (raw)
In-Reply-To: <1401824.1604537031@sss.pgh.pa.us>
References: <1401824.1604537031@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
Attachments:download all (2 files, .tar.gz)xversion-fix-head.patch (text/x-diff, 2.0K) downloaddiff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress/expected/polymorphism.outindex 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 = array_cat,- stype = anycompatiblearray,+ sfunc = array_larger,+ stype = anyarray,
initcond = '{}'
);
-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.sqlindex 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 = array_cat,- stype = anycompatiblearray,+ sfunc = array_larger,+ stype = anyarray,
initcond = '{}'
);
-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
xversion-fix-back.patch (text/x-diff, 1.9K) downloaddiff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress/expected/polymorphism.outindex 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 = array_cat,+ sfunc = array_larger,
stype = anyarray,
initcond = '{}'
);
-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.sqlindex 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 = array_cat,+ sfunc = array_larger,
stype = anyarray,
initcond = '{}'
);
-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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andrew@dunslane.net
Subject: Re: array_cat anycompatible change is breaking xversion upgrade tests
In-Reply-To: <1915573.1604879242@sss.pgh.pa.us>
References: <1401824.1604537031@sss.pgh.pa.us> <1915573.1604879242@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox