Re: pg_total_relation_size() could not open relation with OID X

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_total_relation_size() could not open relation with OID X
Date: 2005-09-29 14:19:14
Message-ID: 20050929141914.GC5272@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-09-29 14:26:43 Re: [PATCHES] Proposed patch for sequence-renaming problems
Previous Message Tino Wildenhain 2005-09-29 13:40:08 Re: postgresql clustering