95
95
select ROW('ABC','DEF') ~>=~ ROW('DEF','ABC') as false;
96
96
select ROW('ABC','DEF') ~~ ROW('DEF','ABC') as fail;
98
-- Comparisons of ROW() expressions can cope with some type mismatches
99
select ROW(1,2) = ROW(1,2::int8);
100
select ROW(1,2) in (ROW(3,4), ROW(1,2));
101
select ROW(1,2) in (ROW(3,4), ROW(1,2::int8));
98
103
-- Check row comparison with a subselect
99
104
select unique1, unique2 from tenk1
100
105
where (unique1, unique2) < any (select ten, ten from tenk1 where hundred < 3)
104
109
-- Also check row comparison with an indexable condition
105
select thousand, tenthous from tenk1
106
where (thousand, tenthous) >= (997, 5000)
107
order by thousand, tenthous;
111
select thousand, tenthous from tenk1
112
where (thousand, tenthous) >= (997, 5000)
113
order by thousand, tenthous;
115
select thousand, tenthous from tenk1
116
where (thousand, tenthous) >= (997, 5000)
117
order by thousand, tenthous;
119
-- Check row comparisons with IN
120
select * from int8_tbl i8 where i8 in (row(123,456)); -- fail, type mismatch
123
select * from int8_tbl i8
124
where i8 in (row(123,456)::int8_tbl, '(4567890123456789,123)');
126
select * from int8_tbl i8
127
where i8 in (row(123,456)::int8_tbl, '(4567890123456789,123)');
109
129
-- Check some corner cases involving empty rowtypes