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 1snfvY-005IKq-6n for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 15:03:41 +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 1snfvX-00DgtT-RI for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 15:03:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snfsP-00DbBa-KA for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2024 15:00:26 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snfsM-000Jfz-Bf for pgsql-general@postgresql.org; Mon, 09 Sep 2024 15:00:24 +0000 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id D3C771380246; Mon, 9 Sep 2024 11:00:20 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 09 Sep 2024 11:00:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1725894020; x=1725980420; bh=uvsVh+0rmMIkkwsTMIzo3yqGEDbkQVeuf+hVF3HVT/0=; b= WElMIt9o0Y4rmfq9m6M4zpPXMP4wGjZUM5RM08tp7tykkHgcyfUh/QWf2ZY5JRsY IBhLexXXGJnZmNGYNbSPBb9fjMaJSe9oebkipdasNZobvaqgWL0aM5yoQXaZHoV7 C4jfM1LDDyf2yYSrDmofcIhcVBUeXGG/Oq6Fl0X70i78r7m/7/fpQMbXaO9QP/+7 u7djj6FR9KGzJXwXU0Unkomaxbh7MGLzByQUT23kiQGhjS1Vxvw+CBOovEFIbMsF jZZ+ypcy/Q/7HLUeoRhyDi4BX0ZIbGPwyVwZfCTYDXUEAzv8Pf1KOrDoY0G51VLd +L68qpAeB6GIIL5AfH5tFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1725894020; x= 1725980420; bh=uvsVh+0rmMIkkwsTMIzo3yqGEDbkQVeuf+hVF3HVT/0=; b=N tvJp3F3h1KQ37pKHYtZnCsIYC003JU+SdO3kswTbZSZ6g4zn4UzlFOuyovreMBm2 NwiPSnj9RpyBWzP0RDJMxH2LqfgTVbf4mQQqHVJTTzpWE+veY9/zx4dNEqEfD5dc bKxGakKgC97M000XcoJoPdEjQ/OGZVLKN6V3yvcEN8y3OlE3qKZEMmPZVMguQYZ6 ueXyMNo9khFRNeX8//tjOupyWXKLavvfEr9fY0SQCYd9HKY6xsq9U8w04aMdQQhm 8CYwybXvEyPhWMK1QA5ZWK940OgK1OB++6AEFfhzDACijnic2pcZDbaHzDRrk/Yp EbEbZpGwv1fv27MCLWcLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeijedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeffleegieefgfevudehtdfh keeutdffjeevgeffgeejvedthefgudeiteefheejheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehfrggsrhhitggvieefieekiedusehgmhgrihhlrdgtohhmpdhrtghpthht ohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Sep 2024 11:00:20 -0400 (EDT) Message-ID: <4f5c2262-f869-4707-93cb-735267903da4@aklaver.com> Date: Mon, 9 Sep 2024 08:00:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: infinite loop in an update statement To: Fabrice Chapuis , pgsql-general@postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/9/24 07:55, Fabrice Chapuis wrote: > Hi, > > table a and b are empty, this query does not return. It seems we enter > in infinite loop. > why this update does not return instantly? > > UPDATE table_a a >  SET col1 = (SELECT MIN(b.col1) >                     FROM table_b b >                     WHERE b.col2 = a.col2) Do you have an UPDATE trigger on table_a? > > Regards, > > Fabrice > > -- Adrian Klaver adrian.klaver@aklaver.com