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 1n70ew-0007Ar-JT for pgsql-general@arkaria.postgresql.org; Mon, 10 Jan 2022 19:48:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n70ev-0006wW-EJ for pgsql-general@arkaria.postgresql.org; Mon, 10 Jan 2022 19:48:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n70ev-0006wN-3x for pgsql-general@lists.postgresql.org; Mon, 10 Jan 2022 19:48:49 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n70es-00035n-BQ for pgsql-general@lists.postgresql.org; Mon, 10 Jan 2022 19:48:48 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 376B15C00FD; Mon, 10 Jan 2022 14:48:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 10 Jan 2022 14:48:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ExUEL8rwg+g9z1eLV6n3uUUZrzAmZFJOhAp1BNsmcRw=; b=Q4IBIKgh P8BOoPW76ZLZY0tukzTHQGkGibJJPW43U9peOV+wogcDRHQI/LSmvZ+0we+h3tl4 em6N7USQk7dGdWuT9njXYuCUqMuINGLDSQWOP5pt4W2FAOT4fOUUyYxmRHaVAZLh E7AY1A2HnD1ZVNQglDjthJRZfZMXQHPWjWubd072GwPjiYnQiA1PQcraS6QKf80w dTiR3YnTMUkMu8t2kBqS127Ldt+gt3z6vRO6cf+ZAZZspCp/+VaXUP6FI0L6g19I g+2Vri44qAIbwh/kE/XD4q/hdUNbbxMfhIjtrbRb/bDzKoPb23oNhlSH8qSnN0kV nikB3nWDQa/GMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehuddguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepleefkefhgfelteeigeejkedvjedvlefhueehfedvjeeh ueetveetjeekueffgfehnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpvg hnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Jan 2022 14:48:43 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8D9002A0804; Mon, 10 Jan 2022 16:48:40 -0300 (-03) Date: Mon, 10 Jan 2022 16:48:40 -0300 From: Alvaro Herrera To: Dominique Devienne Cc: pgsql-general@lists.postgresql.org Subject: Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory Message-ID: <202201101948.vbo2sxytus45@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Jan-10, Dominique Devienne wrote: > Given max_locks_per_transaction * (max_connections > > + max_prepared_transactions > ) > from > https://www.postgresql.org/docs/current/runtime-config-locks.html, and > max_conn being 100, that's not many locks. 6400 locks, to be precise. So if your schemas have on average 10 tables each with 3 indexes per table, you could drop at most 160 schemas in one go (but only if you're lucky.) > Given there's only 64 locks per conn by default, how can this work with > over 100 tables? > I'm confused... --DD That value indicates the maximum number of locks that can be taken across all sessions at a time. You can have a single session take that number of locks, or all sessions take 64 locks each. If you really have many more relations that need to be dropped, you could try to issue "DROP SCHEMA...CASCADE" for each schema to drop. It's a lot less convenient than DROP OWNED BY, but it doesn't require to take as many locks simultaneously. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "Los trabajadores menos efectivos son sistematicamente llevados al lugar donde pueden hacer el menor daño posible: gerencia." (El principio Dilbert)