Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0 - Mailing list pgsql-general

From Tom Lane
Subject Re: wiki Disk Usage, table size: ERROR: could not open relation with OID 0
Date
Msg-id 5391.1521071095@sss.pgh.pa.us
Whole thread Raw
In response to Re: wiki Disk Usage, table size: ERROR: could not open relation withOID 0  (Michael Paquier <michael@paquier.xyz>)
Responses Re: wiki Disk Usage, table size: ERROR: could not open relation withOID 0  (Hans Schou <hans.schou@gmail.com>)
List pgsql-general
Michael Paquier <michael@paquier.xyz> 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


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: wiki Disk Usage, table size: ERROR: could not open relation withOID 0
Next
From: chiru r
Date:
Subject: Re: PgBackrest questions