Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncjzW-0004wE-RY for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 08:29:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncjzT-0005t5-OB for pgsql-general@arkaria.postgresql.org; Fri, 08 Apr 2022 08:29:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncjzT-0005sw-DB for pgsql-general@lists.postgresql.org; Fri, 08 Apr 2022 08:29:11 +0000 Received: from smtp-zimbra.meteo.fr ([137.129.16.22] helo=celebrian1.meteo.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncjzR-0004Kf-6k for pgsql-general@postgresql.org; Fri, 08 Apr 2022 08:29:10 +0000 Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id EA14C1C2235 for ; Fri, 8 Apr 2022 10:29:07 +0200 (CEST) Received: from celebrian1.meteo.fr ([127.0.0.1]) by localhost (celebrian1.meteo.fr [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id lU740MizRhXi for ; Fri, 8 Apr 2022 10:29:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by celebrian1.meteo.fr (Postfix) with ESMTP id CF6001C2257 for ; Fri, 8 Apr 2022 10:29:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at celebrian1.meteo.fr Received: from celebrian1.meteo.fr ([127.0.0.1]) by localhost (celebrian1.meteo.fr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eF7_QWmwSPDv for ; Fri, 8 Apr 2022 10:29:07 +0200 (CEST) Received: from zumba5.meteo.fr (zumba5 [172.31.9.201]) by celebrian1.meteo.fr (Postfix) with ESMTP id B3B521C2235 for ; Fri, 8 Apr 2022 10:29:07 +0200 (CEST) Date: Fri, 8 Apr 2022 10:29:06 +0200 (CEST) From: PALAYRET Jacques To: pgsql-general@postgresql.org Message-ID: <472671960.55252257.1649406546838.JavaMail.zimbra@meteo.fr> Subject: PostgreSQL : error hint for LATERAL join MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_950aa42d-e175-4dc4-ba49-4098cdbac9ae" X-Originating-IP: [172.31.9.204] X-Mailer: Zimbra 8.7.11_GA_3822 (ZimbraWebClient - FF91 (Win)/8.7.11_GA_3822) Thread-Index: GnSX+Zm5o+8kolhvW2O1654X3P1A3A== Thread-Topic: PostgreSQL : error hint for LATERAL join List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_950aa42d-e175-4dc4-ba49-4098cdbac9ae Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello,=20 For a LATERAL join, I think the hint (in case of error) is incomplete :=20 " D=C3=89TAIL : The combining JOIN type must be INNER or LEFT for a LATERAL= reference. "=20 to be replaced by :=20 " D=C3=89TAIL : The combining JOIN type must be CROSS, INNER or LEFT for a = LATERAL reference. "=20 Note : it depends on what is needed=20 SELECT *=20 FROM (=20 SELECT 'a'=20 ) t (c1)=20 LEFT OUTER JOIN LATERAL (=20 SELECT 'b', c1=20 ) u(d1) ON true=20 ;=20 c1 | d1 | c1=20 ----+----+----=20 a | b | a=20 (1 ligne)=20 SELECT *=20 FROM (=20 SELECT 'a'=20 ) t (c1)=20 INNER JOIN LATERAL (=20 SELECT 'b', c1=20 ) u(d1) ON true=20 ;=20 c1 | d1 | c1=20 ----+----+----=20 a | b | a=20 (1 ligne)=20 SELECT *=20 FROM (=20 SELECT 'a'=20 ) t (c1)=20 CROSS JOIN LATERAL (=20 SELECT 'b', c1=20 ) u(d1)=20 ;=20 c1 | d1 | c1=20 ----+----+----=20 a | b | a=20 (1 ligne)=20 Regards=20 ----- M=C3=A9t=C3=A9o-France -----=20 PALAYRET JACQUES=20 DCSC/GDC=20 jacques.palayret@meteo.fr=20 Fixe : +33 561078319=20 --=_950aa42d-e175-4dc4-ba49-4098cdbac9ae Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hello,

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

" D=C3=89T= AIL : The combining JOIN type must be INNER or LEFT for a LATERAL reference= . "
 to be replaced by :
" D=C3=89TAIL : The combining JOIN type= must be CROSS, INNER or LEFT for a LATERAL reference. "

Note : it d= epends 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<= br>(1 ligne)

SELECT *
FROM (
SELECT 'a'
) t (c1)
 I= NNER JOIN LATERAL (
SELECT 'b', c1
) u(d1) ON true
;
 c1 |= d1 | c1
----+----+----
 a  | b  | a
(1 ligne)
<= br>SELECT *
FROM (
SELECT 'a'
) t (c1)
 CROSS JOIN LATERAL= (
SELECT 'b', c1
) u(d1)
;
 c1 | d1 | c1
----+----+---= -
 a  | b  | a
(1 ligne)


Regards
<= div data-marker=3D"__SIG_PRE__">----- M=C3=A9t=C3=A9o-France -----
PALAY= RET JACQUES
DCSC/GDC
jacques.palayret@meteo.fr
Fixe : +33 561078= 319
--=_950aa42d-e175-4dc4-ba49-4098cdbac9ae--