Re: BUG #16577: Segfault on altering a table located in a dropped tablespace

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Michael Paquier <michael@paquier.xyz>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2020-10-28T13:59:24Z
Lists: pgsql-bugs
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2020-Oct-28, Michael Paquier wrote:
>> 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.

Yeah, as long as the patched version won't actively fail when those
pg_shdepend entries are missing, I don't think a backpatch is too
hazardous.  It might be worth checking that the extra entries don't
create huge problems if one does downgrade after some of them exist
--- but my feeling for how that mechanism works is that it'd Just
Work, and indeed provide the missing DROP protection even without
explicit action by the backend.

I would not be too excited about offering instructions for people
to manually add/remove the dependency entries.  The amount of
value added, versus the risks of bollixing things completely,
doesn't sound like a good tradeoff.

			regards, tom lane



Commits

  1. Prevent drop of tablespaces used by partitioned relations

  2. Don't create relfilenode for relations without storage