find_inheritance_children() and ALTER TABLE NO INHERIT

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: find_inheritance_children() and ALTER TABLE NO INHERIT
Date: 2015-12-02 08:55:14
Message-ID: 565EB1F2.7000201@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Currently find_inheritance_children() is smart enough to skip a child
table that it finds has been dropped concurrently after it gets a lock on
the same. It does so by looking up the child relid in syscache. It seems
it should also check if the table is still in the list of children of the
parent. Doing so by scanning the pg_inherits(inhparent) index may likely
be inefficient. So, how about adding that syscache on
pg_inherits(inherelid, inhparent) [1]?

I was prompted by a report sometime ago on -general [2] about the "could
not find inherited attribute..." error. Also, it was reported as a bug few
years ago where locking parent exclusively in ALTER TABLE NO INHERIT as a
solution was dismissed for being prone to deadlock issues [3].

Would it be worth the trouble?

Thanks,
Amit

[1] http://www.postgresql.org/message-id/25515.1149652014@sss.pgh.pa.us
[2] http://www.postgresql.org/message-id/55BA1A06.1000100@gmail.com
[3] http://www.postgresql.org/message-id/19666.1213709303@sss.pgh.pa.us

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-12-02 09:06:21 Re: CustomScan in a larger structure (RE: CustomScan support on readfuncs.c)
Previous Message Dave Page 2015-12-02 08:53:07 Re: El Capitan Removes OpenSSL Headers