pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16577: Segfault on altering a table located in a dropped tablespace
Date: Mon, 10 Aug 2020 14:59:26 -0400
Message-ID: <3247405.1597085966@sss.pgh.pa.us> (raw)
In-Reply-To: <20200810182412.GA19588@alvherre.pgsql>
References: <20200810182412.GA19588@alvherre.pgsql>

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2020-Aug-09, Tom Lane wrote:
>> Michael Paquier <michael@paquier.xyz> writes:
>>> For a normal table we would complain that the tablespace is not empty
>>> when attempting to drop the tablespace.  But here we have only one
>>> partitioned table still holding references to the tablespace.

> Ah, so it turns out that the physical files were necessary after all.
> Maybe the solution to this problem is indeed to have them.  It means
> partly reverting this commit:

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.

> 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).

			regards, tom lane





view thread (22+ messages)  latest in thread

Message-ID: <3247405.1597085966@sss.pgh.pa.us>
Permalink:  ../3247405.1597085966@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3247405.1597085966@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, michael@paquier.xyz, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16577: Segfault on altering a table located in a dropped tablespace
  In-Reply-To: <3247405.1597085966@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox