Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA6SA-0004hW-Ku for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2017 03:46:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eA6S9-0003ca-MF for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2017 03:46:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eA6S9-0003cD-05 for pgsql-general@postgresql.org; Thu, 02 Nov 2017 03:46:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eA6S6-0004Ld-20 for pgsql-general@postgresql.org; Thu, 02 Nov 2017 03:46:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vA23jtea023106; Wed, 1 Nov 2017 23:45:55 -0400 From: Tom Lane To: Adam Brusselback cc: Justin Pryzby , pgsql-general@postgresql.org Subject: Re: Possible bug: could not open relation with OID [numbers] SQL State: XX000 In-reply-to: <21716.1509592353@sss.pgh.pa.us> References: <20171101220354.GB22239@telsasoft.com> <13901.1509586595@sss.pgh.pa.us> <21716.1509592353@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 01 Nov 2017 23:12:33 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23104.1509594355.1@sss.pgh.pa.us> Date: Wed, 01 Nov 2017 23:45:55 -0400 Message-ID: <23105.1509594355@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org I wrote: > You could have encountered it anytime since TOAST was invented, or at > least since RETURN QUERY was invented (the latter is newer IIRC). > The fact that the bug has been there so long and has only been reported > a couple of times is the main reason why I'm loath to take a brute > force duplicate-the-data approach to fixing it. Such a fix would > penalize many more people than it would help. Just thinking idly about what a not-so-brute-force fix might look like ... I wonder if we could postpone the actual drop of toast tables to end of transaction? I'm not sure how messy that would be, or if it would have negative consequences elsewhere. But it might be an idea. We already postpone removal of the underlying disk files till end of transaction, since we don't know if a DROP TABLE will get rolled back. The idea here would be to postpone deletion of the system catalog entries for the toast table as well. I'm not likely to work on this idea myself in the near future, but if anyone else is feeling motivated to attack the problem, have at it ... regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general