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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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: 2021-01-14 04:49:49
Message-ID: X//NbVXkfNkQYBm/@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jan 13, 2021 at 09:57:00AM -0300, Alvaro Herrera wrote:
> On 2021-Jan-13, Michael Paquier wrote:
>> I have not found a thread discussing that around the date of this
>> commit, but I'll take your word on that.
>
> I bet you didn't search pgsql-patches ;-)
> https://www.postgresql.org/message-id/flat/20050703051522.GA13207%40surnet.cl

Ah, thanks. I only looked at -hackers and -bugs. This makes sense.

>> For now we assume that this code path is taken only for partitioned
>> tables or indexes per the logic in heap_create(). Perhaps it would be
>> better to add to this code path, or to recordDependencyOnTablespace()
>> an assertion to check that only the supported relkinds register this
>> dependency? If a new relkind is added, it would be easy to miss that
>> this shared dependency may need to be supported.
>
> Hmm ... the intent here is that if there is no storage, but a tablespace
> is specified, then a dependency protects. This should be agnostic to
> relkind considerations. I had first written the new symbol as
> SHARED_DEPENDENCY_PARTITIONED_TABLE but then I realized the error of my
> ways :-)

Yeah, SHARED_DEPENDENCY_TABLESPACE is much better. Perhaps I am just
too much willing to add unnecessary defenses, so I am fine with any
decision you'll take here.

In short, I am fine with what you have. Thanks for taking the time to
sort this stuff out.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tim Kelly 2021-01-14 16:39:52 questions about porting postgresql to older operating system
Previous Message Kyotaro Horiguchi 2021-01-14 04:30:24 Re: BUG #16807: Assert failed in postgres_fdw/estimate_path_cost_size with an empty foreign table