Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewG4z-0003OB-Mb for pgsql-general@arkaria.postgresql.org; Wed, 14 Mar 2018 23:45:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ewG4x-0006bh-Rb for pgsql-general@arkaria.postgresql.org; Wed, 14 Mar 2018 23:45:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewG4x-0006b9-73 for pgsql-general@lists.postgresql.org; Wed, 14 Mar 2018 23:45:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewG4p-00050w-OX for pgsql-general@postgresql.org; Wed, 14 Mar 2018 23:45:05 +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 w2ENitc6005392; Wed, 14 Mar 2018 19:44:55 -0400 From: Tom Lane To: Michael Paquier cc: Hans Schou , pgsql-general Subject: Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0 In-reply-to: <20180314233238.GB617@paquier.xyz> References: <20180314233238.GB617@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Thu, 15 Mar 2018 08:32:38 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5390.1521071095.1@sss.pgh.pa.us> Date: Wed, 14 Mar 2018 19:44:55 -0400 Message-ID: <5391.1521071095@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Wed, Mar 14, 2018 at 04:17:54PM +0100, Hans Schou wrote: >> I got the message >> ERROR: could not open relation with OID 0 >> when running the "General Table Size Information" from >> https://wiki.postgresql.org/wiki/Disk_Usage >> I'm running version 9.1.9 so it should be working according to the >> wiki. > You should update and upgrade. 9.1 has fallen out of community support > 1 year and a half ago, and 9.1.9 is utterly outdated. The query does fail on < 9.2, because on rows with no reltoastrelid it will call pg_total_relation_size(0), and we didn't make those functions forgiving of bogus OIDs until 9.2. Given that pre-9.2 is well out of support I didn't feel like complicating the query to handle that; what I did do was change the labeling to say "works with >= 9.2" instead of "works with >= 9.0". But hey, it's a wiki; if you feel more ambitious, edit away. regards, tom lane