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

Commit5ce51f8

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 parent6bb1b38 commit5ce51f8

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
@@ -579,24 +579,24 @@ select q2, sql_if(q2 > 0, q2, q2 + 1) from int8_tbl;
579579
(5 rows)
580580

581581
-- another sort of polymorphic aggregate
582-
CREATE AGGREGATEarray_cat_accum (anyarray)
582+
CREATE AGGREGATEarray_larger_accum (anyarray)
583583
(
584-
sfunc =array_cat,
584+
sfunc =array_larger,
585585
stype = anyarray,
586586
initcond = '{}'
587587
);
588-
SELECTarray_cat_accum(i)
588+
SELECTarray_larger_accum(i)
589589
FROM (VALUES (ARRAY[1,2]), (ARRAY[3,4])) as t(i);
590-
array_cat_accum
591-
-----------------
592-
{1,2,3,4}
590+
array_larger_accum
591+
--------------------
592+
{3,4}
593593
(1 row)
594594

595-
SELECTarray_cat_accum(i)
595+
SELECTarray_larger_accum(i)
596596
FROM (VALUES (ARRAY[row(1,2),row(3,4)]), (ARRAY[row(5,6),row(7,8)])) as t(i);
597-
array_cat_accum
598-
-----------------------------------
599-
{"(1,2)","(3,4)","(5,6)","(7,8)"}
597+
array_larger_accum
598+
--------------------
599+
{"(5,6)","(7,8)"}
600600
(1 row)
601601

602602
-- another kind of polymorphic aggregate
@@ -636,6 +636,8 @@ create aggregate build_group(int8, integer) (
636636
STYPE = int8[]
637637
);
638638
-- check proper resolution of data types for polymorphic transfn/finalfn
639+
create function first_el_transfn(anyarray, anyelement) returns anyarray as
640+
'select $1 || $2' language sql immutable;
639641
create function first_el(anyarray) returns anyelement as
640642
'select $1[1]' language sql strict immutable;
641643
create aggregate first_el_agg_f8(float8) (
@@ -644,7 +646,7 @@ create aggregate first_el_agg_f8(float8) (
644646
FINALFUNC = first_el
645647
);
646648
create aggregate first_el_agg_any(anyelement) (
647-
SFUNC =array_append,
649+
SFUNC =first_el_transfn,
648650
STYPE = anyarray,
649651
FINALFUNC = first_el
650652
);

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,17 +394,17 @@ select q2, sql_if(q2 > 0, q2, q2 + 1) from int8_tbl;
394394

395395
-- another sort of polymorphic aggregate
396396

397-
CREATEAGGREGATEarray_cat_accum (anyarray)
397+
CREATEAGGREGATEarray_larger_accum (anyarray)
398398
(
399-
sfunc=array_cat,
399+
sfunc=array_larger,
400400
stype= anyarray,
401401
initcond='{}'
402402
);
403403

404-
SELECTarray_cat_accum(i)
404+
SELECTarray_larger_accum(i)
405405
FROM (VALUES (ARRAY[1,2]), (ARRAY[3,4]))as t(i);
406406

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

410410
-- another kind of polymorphic aggregate
@@ -445,6 +445,9 @@ create aggregate build_group(int8, integer) (
445445

446446
-- check proper resolution of data types for polymorphic transfn/finalfn
447447

448+
createfunctionfirst_el_transfn(anyarray, anyelement) returns anyarrayas
449+
'select $1 || $2' language sql immutable;
450+
448451
createfunctionfirst_el(anyarray) returns anyelementas
449452
'select $1[1]' language sql strict immutable;
450453

@@ -455,7 +458,7 @@ create aggregate first_el_agg_f8(float8) (
455458
);
456459

457460
createaggregatefirst_el_agg_any(anyelement) (
458-
SFUNC=array_append,
461+
SFUNC=first_el_transfn,
459462
STYPE= anyarray,
460463
FINALFUNC= first_el
461464
);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp