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 1qlrf5-004esi-Ha for pgsql-docs@arkaria.postgresql.org; Thu, 28 Sep 2023 14:06:39 +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 1qlrf3-00DRDg-CF for pgsql-docs@arkaria.postgresql.org; Thu, 28 Sep 2023 14:06:37 +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 1qlrf3-00DRDE-4A for pgsql-docs@lists.postgresql.org; Thu, 28 Sep 2023 14:06:37 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlrf0-0086WH-0R for pgsql-docs@lists.postgresql.org; Thu, 28 Sep 2023 14:06:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 38SE6TnP947975; Thu, 28 Sep 2023 10:06:29 -0400 From: Tom Lane To: Laurenz Albe cc: Ilya Priven , pgsql-docs@lists.postgresql.org Subject: Re: Is CREATE INDEX dependent on the session? In-reply-to: References: Comments: In-reply-to Laurenz Albe message dated "Thu, 28 Sep 2023 08:23:35 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <947973.1695909989.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 28 Sep 2023 10:06:29 -0400 Message-ID: <947974.1695909989@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe writes: > On Wed, 2023-09-27 at 11:23 -0400, Ilya Priven wrote: >> Would it warrant a clarification in the documentation: >> - Whether CREATE INDEX is aborted if the session is disconnected, assum= ing it's not in a transaction? > It is aborted as soon as the server realizes that the client is gone, wh= ich may > take a while (see the keepalive parameters and "client_connection_check_= interval"). Note that unless you change client_connection_check_interval to a nondefault value, the server will not notice that the client is gone until it tries to send or receive data. So a command like CREATE INDEX will typically run to completion even if the client drops the connection. I don't think keepalive settings affect this --- they might cause the kernel to realize that the connection is lost earlier than it otherwise would, but that doesn't result in an automatic kill of the server process. > Do you want to propose a patch? There are enough environmental dependencies involved here that any simple description is likely to contain lies. So I'm hesitant to try to put anything about it into the docs. regards, tom lane