Почему следующий запрос not вызывает a "невозможно сравнить типы записей с разными числами столбцов" в PostgreSQL 11.6?
with
s AS (SELECT 1)
, main AS (
SELECT (a) = (b) , (a) = (a), (b) = (b), a, b -- I expect (a) = (b) fails
FROM s
, LATERAL (select 1 as x, 2 as y) AS a
, LATERAL (select 5 as x) AS b
)
select * from main;
В то время как этот делает:
with
x AS (SELECT 1)
, y AS (select 1, 2)
select (x) = (y) from x, y;