PostgreSQL : error hint for LATERAL join

From: PALAYRET Jacques <jacques(dot)palayret(at)meteo(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: PostgreSQL : error hint for LATERAL join
Date: 2022-04-08 08:29:06
Message-ID: 472671960.55252257.1649406546838.JavaMail.zimbra@meteo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

For a LATERAL join, I think the hint (in case of error) is incomplete :

" DÉTAIL : The combining JOIN type must be INNER or LEFT for a LATERAL reference. "
to be replaced by :
" DÉTAIL : The combining JOIN type must be CROSS, INNER or LEFT for a LATERAL reference. "

Note : it depends on what is needed

SELECT *
FROM (
SELECT 'a'
) t (c1)
LEFT OUTER JOIN LATERAL (
SELECT 'b', c1
) u(d1) ON true
;
c1 | d1 | c1
----+----+----
a | b | a
(1 ligne)

SELECT *
FROM (
SELECT 'a'
) t (c1)
INNER JOIN LATERAL (
SELECT 'b', c1
) u(d1) ON true
;
c1 | d1 | c1
----+----+----
a | b | a
(1 ligne)

SELECT *
FROM (
SELECT 'a'
) t (c1)
CROSS JOIN LATERAL (
SELECT 'b', c1
) u(d1)
;
c1 | d1 | c1
----+----+----
a | b | a
(1 ligne)

Regards
----- Météo-France -----
PALAYRET JACQUES
DCSC/GDC
jacques(dot)palayret(at)meteo(dot)fr
Fixe : +33 561078319

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vijaykumar Jain 2022-04-08 09:46:05 Re: Could not read block 0 in file
Previous Message friend.have_00 2022-04-08 07:01:57 Could not read block 0 in file