SET OPERATIONS: error handling for set operation queries with different amounts of columns
Created by: Piiit
The following statement fails at the last SELECT statement.
We expect to have an error instead, because the second select, i.e. select * from f
returns only 3 columns, whereas select a,b,lower(t) ts, upper(t) te from e
returns 4.
However, we get an SEGFAULT error!
create table e
(
a int,
b char,
t int4range
);
insert into e values
(1,'A','[2,5)'),
(2,'A','[3,4)'),
(3,'A','[7,9)');
create table f
(
a int,
b char,
t int4range
);
insert into f values
(1,'A','[3,4)');
select a,b,lower(t) ts, upper(t) te from e
UNION PERIOD WITH (ts,te,ts,te)
select * from f
order by 1,2,3,4;