Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97f73a9

Browse files
committed
Work around cross-version-upgrade issues created by commit9e38c2b.
Summarily changing the STYPE of regression-test aggregates thatdepend on array_append or array_cat is an issue for the buildfarm'scross-version-upgrade tests, because those aggregates (as definedin the back branches) now won't load into HEAD. Although this seemslike only a minimal risk for genuine user-defined aggregates, weneed to do something for the buildfarm. Hence, adjust the aggregatedefinitions, in both HEAD and the back branches.Discussion:https://postgr.es/m/1401824.1604537031@sss.pgh.pa.usDiscussion:https://postgr.es/m/E1kaQ2c-0005lx-Eg@gemulon.postgresql.org
1 parent72d1727 commit97f73a9

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

‎src/test/regress/expected/polymorphism.out

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -729,24 +729,24 @@ select q2, sql_if(q2 > 0, q2, q2 + 1) from int8_tbl;
729729
(5 rows)
730730

731731
-- another sort of polymorphic aggregate
732-
CREATE AGGREGATEarray_cat_accum (anycompatiblearray)
732+
CREATE AGGREGATEarray_larger_accum (anyarray)
733733
(
734-
sfunc =array_cat,
735-
stype =anycompatiblearray,
734+
sfunc =array_larger,
735+
stype =anyarray,
736736
initcond = '{}'
737737
);
738-
SELECTarray_cat_accum(i)
738+
SELECTarray_larger_accum(i)
739739
FROM (VALUES (ARRAY[1,2]), (ARRAY[3,4])) as t(i);
740-
array_cat_accum
741-
-----------------
742-
{1,2,3,4}
740+
array_larger_accum
741+
--------------------
742+
{3,4}
743743
(1 row)
744744

745-
SELECTarray_cat_accum(i)
745+
SELECTarray_larger_accum(i)
746746
FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t(i);
747-
array_cat_accum
748-
-----------------------------------
749-
{"(1,2)","(3,4)","(5,6)","(7,8)"}
747+
array_larger_accum
748+
--------------------
749+
{"(5,6)","(7,8)"}
750750
(1 row)
751751

752752
-- another kind of polymorphic aggregate
@@ -786,16 +786,18 @@ create aggregate build_group(int8, integer) (
786786
STYPE = int8[]
787787
);
788788
-- check proper resolution of data types for polymorphic transfn/finalfn
789-
create function first_el(anycompatiblearray) returns anycompatible as
789+
create function first_el_transfn(anyarray, anyelement) returns anyarray as
790+
'select $1 || $2' language sql immutable;
791+
create function first_el(anyarray) returns anyelement as
790792
'select $1[1]' language sql strict immutable;
791793
create aggregate first_el_agg_f8(float8) (
792794
SFUNC = array_append,
793795
STYPE = float8[],
794796
FINALFUNC = first_el
795797
);
796-
create aggregate first_el_agg_any(anycompatible) (
797-
SFUNC =array_append,
798-
STYPE =anycompatiblearray,
798+
create aggregate first_el_agg_any(anyelement) (
799+
SFUNC =first_el_transfn,
800+
STYPE =anyarray,
799801
FINALFUNC = first_el
800802
);
801803
select first_el_agg_f8(x::float8) from generate_series(1,10) x;

‎src/test/regress/sql/polymorphism.sql

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,17 +498,17 @@ select q2, sql_if(q2 > 0, q2, q2 + 1) from int8_tbl;
498498

499499
-- another sort of polymorphic aggregate
500500

501-
CREATEAGGREGATEarray_cat_accum (anycompatiblearray)
501+
CREATEAGGREGATEarray_larger_accum (anyarray)
502502
(
503-
sfunc=array_cat,
504-
stype=anycompatiblearray,
503+
sfunc=array_larger,
504+
stype=anyarray,
505505
initcond='{}'
506506
);
507507

508-
SELECTarray_cat_accum(i)
508+
SELECTarray_larger_accum(i)
509509
FROM (VALUES (ARRAY[1,2]), (ARRAY[3,4]))as t(i);
510510

511-
SELECTarray_cat_accum(i)
511+
SELECTarray_larger_accum(i)
512512
FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)]))as t(i);
513513

514514
-- another kind of polymorphic aggregate
@@ -549,7 +549,10 @@ create aggregate build_group(int8, integer) (
549549

550550
-- check proper resolution of data types for polymorphic transfn/finalfn
551551

552-
createfunctionfirst_el(anycompatiblearray) returns anycompatibleas
552+
createfunctionfirst_el_transfn(anyarray, anyelement) returns anyarrayas
553+
'select $1 || $2' language sql immutable;
554+
555+
createfunctionfirst_el(anyarray) returns anyelementas
553556
'select $1[1]' language sql strict immutable;
554557

555558
createaggregatefirst_el_agg_f8(float8) (
@@ -558,9 +561,9 @@ create aggregate first_el_agg_f8(float8) (
558561
FINALFUNC= first_el
559562
);
560563

561-
createaggregatefirst_el_agg_any(anycompatible) (
562-
SFUNC=array_append,
563-
STYPE=anycompatiblearray,
564+
createaggregatefirst_el_agg_any(anyelement) (
565+
SFUNC=first_el_transfn,
566+
STYPE=anyarray,
564567
FINALFUNC= first_el
565568
);
566569

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp