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 1kXlhE-000582-Ti for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Oct 2020 13:41:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXlhD-0005eX-JN for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Oct 2020 13:40:59 +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 1kXlhC-0005eP-Jw for pgsql-bugs@lists.postgresql.org; Wed, 28 Oct 2020 13:40:59 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXlh5-0001bL-5R for pgsql-bugs@lists.postgresql.org; Wed, 28 Oct 2020 13:40:58 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2DCFB5C0131; Wed, 28 Oct 2020 09:40:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 28 Oct 2020 09:40:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=lb3CQ02fUT9prjPqh HY7ukk7OAmCoyR5uekE1UHTSq4=; b=dru7gBCqSIUyXw02vQNhtJm8JEwd8VJwJ 6vsEDAjuxX17Ft8Ct2Eoiu1/L5ps2eGQIqEyFxbGIEycXhdXV291in0Jybc5Op9V ivPVXuzSq9GW7oQo4DGs4T+9Koqh+MCjFjRvvGH0D/o63FJe7/SiUeZT87NlpD0J NUdjDeL3K3lubJJUlGUAAg+ZhNdNuJ7rcOQOg4uWnOXFgYXh4czxzZ8NX0bjKWga CCJnP95MCzRgFsIjTHec9xXa1lcbg1udWF4H2CU+2uUuy8Ost4rqdGk/cDSRHx44 JHr0DDGr2EHM3ITlxP5dg5XLSdvSBrLWlWJcTsB6OAyXIbykstCug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrledugdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtuggjfgesthdtredttdervdenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepvefgleevgeeujeeghfegteeghfegheeifeehheelteetiedu ieeihffggfehffetnecukfhppeduledtrdelhedrudelrddugeeknecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 1F75B3280067; Wed, 28 Oct 2020 09:40:48 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 86BCA2A064B; Wed, 28 Oct 2020 10:40:45 -0300 (-03) Date: Wed, 28 Oct 2020 10:40:45 -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: <20201028134045.GA6709@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201028051821.GI28445@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Oct-28, Michael Paquier wrote: > On Thu, Oct 15, 2020 at 12:19:59PM -0300, Alvaro Herrera wrote: > > It just dawned on me that a way to fix this is to use a pg_shdepend > > entry to protect the tablespace from being dropped. > > Haven't thought of that approach, good idea! That would not be > backpatchable but that would be a solution that does not require > creating files where we don't need them. Did you begin to look at > that? I haven't started on this one yet, but I intend to do so shortly. Strictly speaking, we can still introduce a new category of pg_shdepend entries in back branches; it won't break anything that works today. And while it won't fix the problem on existing partitioned tables, it is possible to have users run a query on each database to create any rows needed. The only *actual* incompatibility is that once you upgrade and create the rows, an older server of the same major may misbehave when does rows are present. But do we ever see users going back to previous minors? I think this isn't really a terrible problem in practice. And even if it is, users can work around it by deleting the offending rows. What do you think?