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.1149652...@sss.pgh.pa.us [2] http://www.postgresql.org/message-id/55ba1a06.1000...@gmail.com [3] http://www.postgresql.org/message-id/19666.1213709...@sss.pgh.pa.us -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers