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 1snfnS-005GsR-1u for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 14:55:19 +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 1snfnQ-00DQrS-ME for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2024 14:55:16 +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 1snfnQ-00DQrK-Bj for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2024 14:55:16 +0000 Received: from mail-oo1-xc2b.google.com ([2607:f8b0:4864:20::c2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1snfnN-000Jdc-Iw for pgsql-general@postgresql.org; Mon, 09 Sep 2024 14:55:15 +0000 Received: by mail-oo1-xc2b.google.com with SMTP id 006d021491bc7-5de3d2a4ac3so230023eaf.0 for ; Mon, 09 Sep 2024 07:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725893713; x=1726498513; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=n7VohECRPFsdEpJj6NSLz9VIGqBD9W5y11KwdwtsH6s=; b=OqbGmQeh++olrHeUKw+S0edsx/xWyTrcaJ8nKOEychsS48APa9bqwqq3hKr5bwA0nm 45m28IzpvvZQbFutfx7yxqZL7OthU+A+3wOE9CDQ6jSj0u7oaJk9eOMHmg31B2CAwJAy i4hW8/p7RQGPhBbFFgNxRfNgWtvqR4uD1/63hKq9wu3ow9cqz27Qsxz89D4H65LU3g9I 8TxoSB0Z9YwsKrjRQchybUYcpbvB84tjt2ZEJf5DubJqQddLmLNJO2g4ZMwGlGwm74dQ c7S33AS92TYHYK7LPTfn7n9TICqBCYMmKyFxmU5yH/2OLajp2rHcy/6MC6il84dBhZcJ Fh1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725893713; x=1726498513; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=n7VohECRPFsdEpJj6NSLz9VIGqBD9W5y11KwdwtsH6s=; b=TU9JclizMr7sTIb8SqzXh3IuyfOEkvKxykudtXlE6LGI3qa+iht15RLxZkbA1QBTzD AqrAykhU5EPi7j/DdMQTKEOMk2e5vhWYsfifGw+rfqFgsCZyxxtkMZJo57AWvqVYCnRI ZkGFfjatLLaNlNIrdPUp8toGUE44uNjfP0xsdyUF3Vps8UAj0ea9z5vu7Km9anFUfbVK uTLqrvvjbjY67Ie8zFlTu0dEP9N8hrSzQmvk3S104C6RY4rF5XIu7Cnviga+CEMh/6u3 in+3Y8Hv459/axWYDqtJ3hB5h/mRDLbSqRjh+izlFZ2f4ePmC8ktfktdRtWJ6zb8h7yI UDMQ== X-Gm-Message-State: AOJu0YwNE/j0DqZDHEmub5DPyfTPinboxb8Xh9GTqQkZoZ0Uq2zUMVQu kg8jMbFk42Ixk1/g+tQtWwePYRc+agg2NDy84DptbVzogbSQtHwnfjPQR70OfXW9FmXr7UxCHBE wYooGWCebj4RWJ1YPVaOhbEBlG7cJBWwK X-Google-Smtp-Source: AGHT+IHrsupVGcA5BIHMYsbYpNFmTYA5OpKZRnxh91iXSUhkRPkArgw+bEdYUjdYLTa0nS7+9Q7GZmHFydf10EfzkQI= X-Received: by 2002:a05:6870:96a4:b0:277:f3f6:8c5b with SMTP id 586e51a60fabf-27b82e12057mr5511507fac.4.1725893712640; Mon, 09 Sep 2024 07:55:12 -0700 (PDT) MIME-Version: 1.0 From: Fabrice Chapuis Date: Mon, 9 Sep 2024 16:55:01 +0200 Message-ID: Subject: infinite loop in an update statement To: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000a982870621b0f1cf" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a982870621b0f1cf Content-Type: text/plain; charset="UTF-8" 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) Regards, Fabrice --000000000000a982870621b0f1cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdiBkaXI9Imx0ciI+PGRpdiBkaXI9Imx0ciI+SGksPC9kaXY+PGRp diBkaXI9Imx0ciI+PGJyPjwvZGl2PjxkaXYgZGlyPSJsdHIiPnRhYmxlIGEgYW5kIGIgYXJlIGVt cHR5LCB0aGlzIHF1ZXJ5IGRvZXMgbm90IHJldHVybi4gSXQgc2VlbXMgd2UgZW50ZXIgaW4gaW5m aW5pdGUgbG9vcC48L2Rpdj48ZGl2IGRpcj0ibHRyIj53aHkgdGhpcyB1cGRhdGUgZG9lcyBub3Qg cmV0dXJuIGluc3RhbnRseT88YnI+PGRpdj48YnI+PC9kaXY+PGRpdj48ZGl2PlVQREFURSB0YWJs ZV9hIGHCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoMKgPC9kaXY+PGRpdj7CoFNFVCBjb2wxID0gKFNFTEVDVCBNSU4o Yi5jb2wxKcKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgPC9k aXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCBGUk9NIHRh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