Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbgm8-00GWhq-MV for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Feb 2024 13:00:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rbgm7-009sLL-79 for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Feb 2024 13:00:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbgm6-009sLB-Tb for pgsql-hackers@lists.postgresql.org; Sun, 18 Feb 2024 13:00:06 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rbgm4-007pQv-BI for pgsql-hackers@lists.postgresql.org; Sun, 18 Feb 2024 13:00:05 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d23a22233fso567691fa.2 for ; Sun, 18 Feb 2024 05:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708261203; x=1708866003; darn=lists.postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=SB4B+RaZLXgBuw/MjgSHyUnp/qDlSS/haB1zcOIyQhM=; b=T7YkWfhr4/AmmuA+k/paRQe0Neut29f0bWz5/dFJ8ycR5lGE/4Jd7zs4ONfQtvp4sS ZVBviFzMKmJg1RXQzDJuBTgoDl3OAy/y6HzrQMFRiTXIcIVIZhg/6AU2590BgU4PmXVg Nz0lq9PBnBP46waQo5dbat9kCuyxmxAZ1qDoMdE24E5+Cf5plLaLcB9pyZTVaxZ6fDby a5dnM3kyv2ybkxjzonejDdA6ksRdLYf8ML0DknT6SmN68vX7GMw8J5wP13FA6+5XOq3L 7NPQ9eKMDD90Yd4AJPQsOhJcIbTFsEOESOL1UxL0UB3ZC3MfWW3VWyBwEDB63L0EBOqY +LOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708261203; x=1708866003; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SB4B+RaZLXgBuw/MjgSHyUnp/qDlSS/haB1zcOIyQhM=; b=dr/JMJmIOD0EQKDrbEWxYcTkBH0Nz9LNP68a3+8lJPcIhcZDMWarDo/4rbaYzJiS9I FVg9Hl5KlqcQmNcbYvHGE2/qOwoJsKlpO/omUGTqgEmqcViPERwqKBtcq7VuOeCw6r16 SqfCnBIDbIyzUM0D1sOoeHTb81n7PSjLkv9QSy8+7cFj5NTjMB0bDJ4NFrywKbSQP9RT lY7/xki+iglABMFZrss+H5curdammm8QqEhDtDU6zwBoU5sUXit0Re5G9PWhbtIp6+DQ 4ahonKlxZPR8L01KGCpcxDzjwOIPuKMWsZYHBmhy4G/6GwtEyxxJg81lVC6RdHfvoqIM 96MA== X-Forwarded-Encrypted: i=1; AJvYcCXuzXyqZimCuuHBUpRIxDQg4D6mjaiPG2eJBMVBO9DWc+2PojhHXE2HODKHy1eU5+FF95cz5y/C+uYZQ3QayrSagVyL7IIFPbh7dq96b/Nmu4If X-Gm-Message-State: AOJu0YzRWdT2O5WHdQGigduD+5rxMRN69DhkkZQqOMWJaxGks0wd65Ms Lur0RrBkmSqdL2c5gSo/8tA7qOWaZ0JT8vVBxLUWtvnXA3PU6jXh X-Google-Smtp-Source: AGHT+IFB/na7ngrEEha1MX48n6hDK1tDj1yr+AfaIrBqkzTZiORJIyWh6ah1A+WG6qwst965aZhnKA== X-Received: by 2002:a2e:9cd3:0:b0:2d1:15d0:4714 with SMTP id g19-20020a2e9cd3000000b002d115d04714mr6172642ljj.34.1708261202735; Sun, 18 Feb 2024 05:00:02 -0800 (PST) Received: from [1.0.0.7] ([91.185.76.177]) by smtp.gmail.com with ESMTPSA id s10-20020a2e81ca000000b002d0b40733easm700939ljg.113.2024.02.18.05.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Feb 2024 05:00:02 -0800 (PST) Content-Type: multipart/alternative; boundary="------------qfhRS9pFP0qhW12Ovw4lS4Mf" Message-ID: <56ee4520-e9d1-d519-54fe-c8bff880ce9b@gmail.com> Date: Sun, 18 Feb 2024 16:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Removing unneeded self joins Content-Language: en-US To: Alexander Korotkov Cc: Andrei Lepikhov , "Gregory Stark (as CFM)" , =?UTF-8?Q?Micha=c5=82_K=c5=82eczek?= , PostgreSQL Hackers , Richard Guo References: <64486b0b-0404-e39e-322d-0801154901f3@postgrespro.ru> <8800ccf2-ae82-461c-92a1-d4c0a22f8cf2@postgrespro.ru> <1bd80083-a13e-4e9f-a7ce-73c3faab521c@postgrespro.ru> <922623af-872e-4cdc-9238-129b18bee42d@postgrespro.ru> <107682e0-137a-d0fb-2733-7fc6e9562690@gmail.com> <0c5f461f-e26f-4fd9-9700-91b0e9c38fd6@postgrespro.ru> <336c748b-4ffe-5915-3d3c-ece6d19e021c@gmail.com> <4788f781-31bd-9796-d7d6-588a751c8787@gmail.com> From: Alexander Lakhin In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------qfhRS9pFP0qhW12Ovw4lS4Mf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Alexander, 09.01.2024 01:09, Alexander Korotkov wrote: > Fixed in 30b4955a46. Please look at the following query which fails with an error since d3d55ce57: create table t (i int primary key); select t3.i from t t1  join t t2 on t1.i = t2.i,  lateral (select t1.i limit 1) t3; ERROR:  non-LATERAL parameter required by subquery Best regards, Alexander --------------qfhRS9pFP0qhW12Ovw4lS4Mf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hi Alexander,

09.01.2024 01:09, Alexander Korotkov wrote:
Fixed in 30b4955a46.

Please look at the following query which fails with an error since
d3d55ce57:

create table t (i int primary key);

select t3.i from t t1
 join t t2 on t1.i = t2.i,
 lateral (select t1.i limit 1) t3;

ERROR:  non-LATERAL parameter required by subquery

Best regards,
Alexander
--------------qfhRS9pFP0qhW12Ovw4lS4Mf--