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 1kzfi6-00086y-J6 for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Jan 2021 12:57:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzfi5-0003EM-EL for pgsql-bugs@arkaria.postgresql.org; Wed, 13 Jan 2021 12:57:13 +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 1kzfi4-0003ED-NW for pgsql-bugs@lists.postgresql.org; Wed, 13 Jan 2021 12:57:13 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzfhz-0007xs-J1 for pgsql-bugs@lists.postgresql.org; Wed, 13 Jan 2021 12:57:12 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 5685F1852; Wed, 13 Jan 2021 07:57:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 13 Jan 2021 07:57:04 -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=HAuhyN7eVEYAywKKVoFTfWBu41nGHTMky66Mi1NHE+4=; b=TSXojw3X E8kRIohVf3MgY5yAnnJefDDlF1PBR+F1tX2qeDfHngQZGC9EVqJOfn/Cgx9UMfyr d3AyRoWmmAi+77DB+3mbt9GfWJ8/2EM0/HLDCMDUpQVcjzPyGfSQ4dT4DogHaCTu rq0nq3uAtAUZ9g0ToKomELKSlFrhHLkpepwt8Fa+S4tDEzCOzzfPnKPh2tg4vcwj VgSMuplIuAKsqncjcC/taYkRI+AQcLKJ7oe0p91jm61AIXZUH7Hls8NGdrpZIsAl p1otWKmjFB9v3KXxFLKjF11PctmBomZoa3P3DIcSFwTRjbSPa5d5mFv3wSXUuv1Z /5cWaG0F6cK6zA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedukedrtdefgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeevjeejkeejjeeiveeuuddvfeffiefhfffgleehgfeugeej heduvdefkeeihffftdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukf hppeduledtrdelhedrudelrddujeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 33859240057; Wed, 13 Jan 2021 07:57:03 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 63BD92A0FC3; Wed, 13 Jan 2021 09:57:00 -0300 (-03) Date: Wed, 13 Jan 2021 09:57:00 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Tomas Vondra , Tom Lane , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16577: Segfault on altering a table located in a dropped tablespace Message-ID: <20210113125700.GA9451@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Jan-13, Michael Paquier wrote: > On Tue, Jan 12, 2021 at 12:08:04PM -0300, Alvaro Herrera wrote: > > That would bloat the catalog with a lot of entries for stuff that can be > > detected with the current method. Did you notice that the code is > > removing an "#ifdef NOT_USED" line to enable existing code? Well, when > > I wrote this code in 2005 (59d1b3d99e69) it was doing things as you > > suggest, but in the end we decided that it wasn't necessary so it was > > taken out. > > I have not found a thread discussing that around the date of this > commit, but I'll take your word on that. I bet you didn't search pgsql-patches ;-) https://www.postgresql.org/message-id/flat/20050703051522.GA13207%40surnet.cl > I just have one small comment. > > + if (!create_storage && reltablespace != InvalidOid) > + recordDependencyOnTablespace(RelationRelationId, relid, > + reltablespace); > For now we assume that this code path is taken only for partitioned > tables or indexes per the logic in heap_create(). Perhaps it would be > better to add to this code path, or to recordDependencyOnTablespace() > an assertion to check that only the supported relkinds register this > dependency? If a new relkind is added, it would be easy to miss that > this shared dependency may need to be supported. Hmm ... the intent here is that if there is no storage, but a tablespace is specified, then a dependency protects. This should be agnostic to relkind considerations. I had first written the new symbol as SHARED_DEPENDENCY_PARTITIONED_TABLE but then I realized the error of my ways :-) -- Álvaro Herrera Valdivia, Chile Tom: There seems to be something broken here. Teodor: I'm in sackcloth and ashes... Fixed. http://archives.postgresql.org/message-id/482D1632.8010507@sigaev.ru