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

Commit5c456d3

Browse files
committed
Work around cross-version-upgrade issues created by commit 9e38c2bb5.
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 parent6daf725 commit5c456d3

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

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

Lines changed: 13 additions & 11 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 (anyarray)
732+
CREATE AGGREGATEarray_larger_accum (anyarray)
733733
(
734-
sfunc =array_cat,
734+
sfunc =array_larger,
735735
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,6 +786,8 @@ 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_transfn(anyarray, anyelement) returns anyarray as
790+
'select $1 || $2' language sql immutable;
789791
create function first_el(anyarray) returns anyelement as
790792
'select $1[1]' language sql strict immutable;
791793
create aggregate first_el_agg_f8(float8) (
@@ -794,7 +796,7 @@ create aggregate first_el_agg_f8(float8) (
794796
FINALFUNC = first_el
795797
);
796798
create aggregate first_el_agg_any(anyelement) (
797-
SFUNC =array_append,
799+
SFUNC =first_el_transfn,
798800
STYPE = anyarray,
799801
FINALFUNC = first_el
800802
);

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

Lines changed: 8 additions & 5 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 (anyarray)
501+
CREATEAGGREGATEarray_larger_accum (anyarray)
502502
(
503-
sfunc=array_cat,
503+
sfunc=array_larger,
504504
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,6 +549,9 @@ create aggregate build_group(int8, integer) (
549549

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

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

@@ -559,7 +562,7 @@ create aggregate first_el_agg_f8(float8) (
559562
);
560563

561564
createaggregatefirst_el_agg_any(anyelement) (
562-
SFUNC=array_append,
565+
SFUNC=first_el_transfn,
563566
STYPE= anyarray,
564567
FINALFUNC= first_el
565568
);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp