Re: pg_total_relation_size() could not open relation with OID X - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_total_relation_size() could not open relation with OID X
Date
Msg-id 20050929141914.GC5272@surnet.cl
Whole thread Raw
In response to pg_total_relation_size() could not open relation with OID X  (Michael Fuhr <mike@fuhr.org>)
Responses Re: pg_total_relation_size() could not open relation with OID X
List pgsql-hackers
On Wed, Sep 28, 2005 at 10:25:16PM -0600, Michael Fuhr wrote:

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

The code is obviously confused between Oid and relfilenode.  The
calculate_total_relation_size() function gets a relfilenode parameter
and then tries to call relation_open() with it.  This is wrong.

I'll submit/commit a patch fixing this, later today.  Thanks for the
test case.

-- 
Alvaro Herrera       Valdivia, Chile   ICBM: S 39º 49' 17.7", W 73º 14' 26.8"
"Granting software the freedom to evolve guarantees only different results,
not better ones." (Zygo Blaxell)


pgsql-hackers by date:

Previous
From: Tino Wildenhain
Date:
Subject: Re: postgresql clustering
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Proposed patch for sequence-renaming problems