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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16577: Segfault on altering a table located in a dropped tablespace
Date: 2020-08-11 07:04:07
Message-ID: 20200811070407.GJ17986@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Aug 10, 2020 at 02:59:26PM -0400, Tom Lane wrote:
> I think actually the hardest part will be figuring out what is the
> conversion path, e.g. will pg_upgrade have to know about this.
>
> One point that strikes me is that that will put us in a place where
> "does this relation have storage" is not a binary choice. The possible
> answers will be "yes", "no", or "has an empty stub file". If we try
> to take shortcuts rather than handling that honestly, we'll be in for
> more bugs.

Hmm. Creating a file for partitioned table would be a completely new
thing as well. heap_create() has never created a file for partitioned
tables since 10 so this could open to a new class of bugs.

>> As for the crash at hand, it seems it can be solved easily by making
>> ruleutils avoid trying to dereference a null pointer, as in the attached
>> patch.
>
> Meh. I have a feeling that that's just the tip of the iceberg of
> things that will go wrong in this scenario. I'm not sure how much
> band-aid code we want to expend on the case --- after all, tablespace
> create/drop is a superuser-only activity, so people aren't doing it
> carelessly (one hopes).

+1. I would suspect that it is not the only code path that would run
into issues.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Christoph Berg 2020-08-11 09:05:52 Re: [noreply@postgresql.org: BUG #16575: Linux Mint 20, ulyana won't update postgres as described]
Previous Message Devrim Gündüz 2020-08-10 23:54:24 Re: BUG #16573: pgbouncer 1.14 addition to EL6 breaks installation