You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reduce dependency to money data type in main regression test suite
Most of these tests have been introduced in 6dd8b00, to check for
behaviors related to hashing and hash plans, and money is a data type
with btree support but no hash functions. These tests are switched to
use varbit instead, to provide the same coverage.
Some other tests historically used money but don't really need it for
what they wanted to test (see rules.sql). Plans and coverage are
unchanged after the modifications done here.
Support for money may be removed a a later point, but this needs more
discussion.
Discussion: https://postgr.es/m/[email protected]
Copy file name to clipboardExpand all lines: src/test/regress/expected/union.out
+24-24Lines changed: 24 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -479,7 +479,7 @@ reset enable_hashagg;
479
479
-- non-hashable type
480
480
set enable_hashagg to on;
481
481
explain (costs off)
482
-
select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
482
+
select x from (values ('11'::varbit), ('10'::varbit)) _(x) union select x from (values ('11'::varbit), ('10'::varbit)) _(x);
483
483
QUERY PLAN
484
484
-----------------------------------------------
485
485
Unique
@@ -492,7 +492,7 @@ select x from (values (100::money), (200::money)) _(x) union select x from (valu
492
492
493
493
set enable_hashagg to off;
494
494
explain (costs off)
495
-
select x from (values (100::money), (200::money)) _(x) union select x from (values (100::money), (300::money)) _(x);
495
+
select x from (values ('11'::varbit), ('10'::varbit)) _(x) union select x from (values ('11'::varbit), ('10'::varbit)) _(x);
496
496
QUERY PLAN
497
497
-----------------------------------------------
498
498
Unique
@@ -563,7 +563,7 @@ select x from (values (array[1, 2]), (array[1, 3])) _(x) except select x from (v
563
563
564
564
-- non-hashable type
565
565
explain (costs off)
566
-
select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
566
+
select x from (values (array['10'::varbit]), (array['11'::varbit])) _(x) union select x from (values (array['10'::varbit]), (array['01'::varbit])) _(x);
567
567
QUERY PLAN
568
568
-----------------------------------------------
569
569
Unique
@@ -574,12 +574,12 @@ select x from (values (array[100::money]), (array[200::money])) _(x) union selec
574
574
-> Values Scan on "*VALUES*_1"
575
575
(6 rows)
576
576
577
-
select x from (values (array[100::money]), (array[200::money])) _(x) union select x from (values (array[100::money]), (array[300::money])) _(x);
578
-
x
579
-
-----------
580
-
{$100.00}
581
-
{$200.00}
582
-
{$300.00}
577
+
select x from (values (array['10'::varbit]), (array['11'::varbit])) _(x) union select x from (values (array['10'::varbit]), (array['01'::varbit])) _(x);
578
+
x
579
+
------
580
+
{01}
581
+
{10}
582
+
{11}
583
583
(3 rows)
584
584
585
585
set enable_hashagg to off;
@@ -710,7 +710,7 @@ select x from (values (row(1, 2)), (row(1, 3))) _(x) except select x from (value
710
710
-- With an anonymous row type, the typcache does not report that the
711
711
-- type is hashable. (Otherwise, this would fail at execution time.)
712
712
explain (costs off)
713
-
select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
713
+
select x from (values (row('10'::varbit)), (row('11'::varbit))) _(x) union select x from (values (row('10'::varbit)), (row('01'::varbit))) _(x);
714
714
QUERY PLAN
715
715
-----------------------------------------------
716
716
Unique
@@ -721,19 +721,19 @@ select x from (values (row(100::money)), (row(200::money))) _(x) union select x
721
721
-> Values Scan on "*VALUES*_1"
722
722
(6 rows)
723
723
724
-
select x from (values (row(100::money)), (row(200::money))) _(x) union select x from (values (row(100::money)), (row(300::money))) _(x);
725
-
x
726
-
-----------
727
-
($100.00)
728
-
($200.00)
729
-
($300.00)
724
+
select x from (values (row('10'::varbit)), (row('11'::varbit))) _(x) union select x from (values (row('10'::varbit)), (row('01'::varbit))) _(x);
725
+
x
726
+
------
727
+
(01)
728
+
(10)
729
+
(11)
730
730
(3 rows)
731
731
732
732
-- With a defined row type, the typcache can inspect the type's fields
733
733
-- for hashability.
734
-
create type ct1 as (f1 money);
734
+
create type ct1 as (f1 varbit);
735
735
explain (costs off)
736
-
select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
736
+
select x from (values (row('10'::varbit)::ct1), (row('11'::varbit)::ct1)) _(x) union select x from (values (row('10'::varbit)::ct1), (row('01'::varbit)::ct1)) _(x);
737
737
QUERY PLAN
738
738
-----------------------------------------------
739
739
Unique
@@ -744,12 +744,12 @@ select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union
744
744
-> Values Scan on "*VALUES*_1"
745
745
(6 rows)
746
746
747
-
select x from (values (row(100::money)::ct1), (row(200::money)::ct1)) _(x) union select x from (values (row(100::money)::ct1), (row(300::money)::ct1)) _(x);
748
-
x
749
-
-----------
750
-
($100.00)
751
-
($200.00)
752
-
($300.00)
747
+
select x from (values (row('10'::varbit)::ct1), (row('11'::varbit)::ct1)) _(x) union select x from (values (row('10'::varbit)::ct1), (row('01'::varbit)::ct1)) _(x);
0 commit comments