find_inheritance_children() and ALTER TABLE NO INHERIT - Mailing list pgsql-hackers

From Amit Langote
Subject find_inheritance_children() and ALTER TABLE NO INHERIT
Date
Msg-id 565EB1F2.7000201@lab.ntt.co.jp
Whole thread Raw
Responses Re: find_inheritance_children() and ALTER TABLE NO INHERIT  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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





pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: El Capitan Removes OpenSSL Headers
Next
From: Andres Freund
Date:
Subject: Re: CustomScan in a larger structure (RE: CustomScan support on readfuncs.c)