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

2005-09-29 Thread Alvaro Herrera
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

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

2005-09-29 Thread Alvaro Herrera
I wrote: 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. This is the patch I'm about to apply. Besides fixing this particular problem, I made

[HACKERS] pg_total_relation_size() could not open relation with OID X

2005-09-28 Thread Michael Fuhr
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');