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 1k0x5R-0006Re-H4 for pgsql-general@arkaria.postgresql.org; Thu, 30 Jul 2020 01:10:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k0x5O-0007Pk-CO for pgsql-general@arkaria.postgresql.org; Thu, 30 Jul 2020 01:10:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0x5O-0007Pc-4H for pgsql-general@lists.postgresql.org; Thu, 30 Jul 2020 01:10:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0x5L-0001Aj-Ro for pgsql-general@postgresql.org; Thu, 30 Jul 2020 01:10:17 +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 06U1AEh41346558; Wed, 29 Jul 2020 21:10:14 -0400 From: Tom Lane To: Steve Baldwin cc: pgsql-general Subject: Re: Transaction prevention In-reply-to: References: <1344584.1596068614@sss.pgh.pa.us> Comments: In-reply-to Steve Baldwin message dated "Thu, 30 Jul 2020 10:50:33 +1000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1346556.1596071413.1@sss.pgh.pa.us> Date: Wed, 29 Jul 2020 21:10:13 -0400 Message-ID: <1346557.1596071413@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Steve Baldwin writes: > Thanks Tom. The idle_in_transaction_session_timeout could work well, but it > seems to be just a default that can be overridden by a user post-login (or > am I missing something?). It is that, but if you have an actively malicious user then you need to keep them from issuing SQL directly at all. There are far too many ways to cause effective denial-of-service, eg a single query that runs "forever". > I'm thinking of setting lock_timeout as part of > the migration process so it will fail if it is unable to obtain a lock in a > 'reasonable' amount of time. I wonder what other folks do? If you'd rather fail the migration process, sure. regards, tom lane