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 1kzLHH-00057s-Fp for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Jan 2021 15:08:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kzLHG-0006lz-Df for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Jan 2021 15:08:10 +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 1kzLHG-0006ls-7X for pgsql-bugs@lists.postgresql.org; Tue, 12 Jan 2021 15:08:10 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kzLHE-0000jv-BC for pgsql-bugs@lists.postgresql.org; Tue, 12 Jan 2021 15:08:09 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 69F8A5C08AD; Tue, 12 Jan 2021 10:08:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 12 Jan 2021 10:08:07 -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=9jPiZKUs0LuarhVqllhT9eL/WNeHwPFJHoS6CbVAuBw=; b=JQQFSf+Q BXR1J7rE0nc08wUE6tNU5oevK0Il5ZgXrI4Y0UDgRJUqthlvmGMwJ3+/VNEqGKGq 7szqcYns5HbPlJcgvpiYqsbhrYtg2CFWp5yIyNOfGUEFmYC0qAllt6f3BfUgXqcA kBXDuXBVM+w0T5zYlo9DndSwFJ0I97MtE/4mg9RYaX1PeZ+q50fYkD+x9nffO182 NyA7CYQ3pBka9GTJFHgkfdpMkIrkVn9au3uAx6BgRzc4irwKnK5iXCNGA3qIuD+J Lpz/p6704UtuKl7W1gYd6GL4dp7AaxbnGIeGJxHZv/pfwMX8ZjPGFvIXBJjXC/Vy wtWpQaItYcKnVw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedukedrtddtgdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueefieei vefgteehueefteehvdenucfkphepudeltddrleehrdduledrudejjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 05CB1108005B; Tue, 12 Jan 2021 10:08:06 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 241D52A0FBF; Tue, 12 Jan 2021 12:08:04 -0300 (-03) Date: Tue, 12 Jan 2021 12:08:04 -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: <20210112150804.GA27528@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-12, Michael Paquier wrote: > + /* > + * If a tablespace is specified, removal of that tablespace is normally > + * protected by the existence of a physical file; but for relations with > + * no files, add a pg_shdepend entry to account for that. > + */ > + if (!create_storage && reltablespace != InvalidOid) > > On HEAD, could we consider using this dependency link even for > relations that have physical files, and remove the physical file > check? Could that make the dependency handling cleaner? 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. -- Álvaro Herrera 39°49'30"S 73°17'W "Someone said that it is at least an order of magnitude more work to do production software than a prototype. I think he is wrong by at least an order of magnitude." (Brian Kernighan)