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 1n72Eo-0002aD-PA for pgsql-general@arkaria.postgresql.org; Mon, 10 Jan 2022 21:29:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n72En-0006Dw-I2 for pgsql-general@arkaria.postgresql.org; Mon, 10 Jan 2022 21:29:57 +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 1n72En-0006Di-7h for pgsql-general@lists.postgresql.org; Mon, 10 Jan 2022 21:29:57 +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 1n72Eg-0008RR-CR for pgsql-general@lists.postgresql.org; Mon, 10 Jan 2022 21:29:56 +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 20ALTknr2412213; Mon, 10 Jan 2022 16:29:46 -0500 From: Tom Lane To: "David G. Johnston" cc: Dominique Devienne , "pgsql-generallists.postgresql.org" Subject: Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory In-reply-to: References: <2208869.1641836366@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Mon, 10 Jan 2022 14:08:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2412211.1641850186.1@sss.pgh.pa.us> Date: Mon, 10 Jan 2022 16:29:46 -0500 Message-ID: <2412212.1641850186@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Mon, Jan 10, 2022 at 12:09 PM Dominique Devienne > wrote: >> Tom wrote "relation" for the number of locks necessary for DROP OWNED BY. >> What does it mean in this context? relation = table? > I'm confused here a bit as well. The items being talked about are tables > and indexes, both of which manifest as files on the filesystem. But not > all relations do (e.g., views). But if this isn't tied to the filesystem > then I would expect that other object types, especially functions, would > require locking as well, but those are decidedly not relations. I was wrong actually --- I wrote that thinking that we acquire exclusive lock when dropping a relation (where relation may be defined as "something with a pg_class entry"). That's true, but these days we acquire a lock when deleting *any* cataloged database object. So you'd also need a lock for each schema, function, etc that was due to get dropped. This is basically to avoid problems in case of concurrent drop commands. It's still true that the size of a relation in columns or rows is not relevant here. regards, tom lane