Skip site navigation (1) Skip section navigation (2)

pg_total_relation_size() could not open relation with OID X

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_total_relation_size() could not open relation with OID X
Date: 2005-09-29 04:25:16
Message-ID: 20050929042516.GA29525@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Here's a test case for a pg_total_relation_size() failure:

test=> CREATE TABLE foo (id integer);
CREATE TABLE
test=> SELECT oid, relfilenode FROM pg_class WHERE relname = 'foo';
  oid  | relfilenode 
-------+-------------
 26235 |       26235
(1 row)

test=> SELECT pg_total_relation_size('foo');
 pg_total_relation_size 
------------------------
                      0
(1 row)

test=> TRUNCATE foo;
TRUNCATE TABLE
test=> SELECT oid, relfilenode FROM pg_class WHERE relname = 'foo';
  oid  | relfilenode 
-------+-------------
 26235 |       26237
(1 row)

test=> SELECT pg_total_relation_size('foo');
ERROR:  could not open relation with OID 26237
test=> SELECT pg_total_relation_size(26235);
ERROR:  could not open relation with OID 26237
test=> SELECT pg_relation_size('foo');
 pg_relation_size 
------------------
                0
(1 row)

-- 
Michael Fuhr

Responses

pgsql-hackers by date

Next:From: Jeffrey W. BakerDate: 2005-09-29 04:27:20
Subject: Re: [PERFORM] A Better External Sort?
Previous:From: Bruce MomjianDate: 2005-09-29 03:54:48
Subject: Open items list

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group