Re: pg_relation_size locking

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_relation_size locking
Date: 2005-12-13 05:07:08
Message-ID: 439E56FC.5060809@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Andreas Pflug wrote:
>
>>Alvaro Herrera wrote:
>>
>>>The problem with the original coding was that it used the table Oid to
>>>look up the file name, which is wrong. (Test it with a table that has
>>>been clustered or an index that has been reindexed.)
>>
>>Um, can't test at the moment. The oldcode used pg_class->relfilnode,
>>which delivers "Name of the on-disk file of this relation" according to
>>the docs. What's wrong with that?
>
>
> Hum, nothing that I can see, but I changed that code precisely because
> somebody complained that it didn't work after truncating. Do you mean
> "oldcode" as "the contrib code", or "the initially integrated in backend
> code"?

Both, esp. backend/utils/adt/dbsize.c V1.4. and contrib/dbsize/dbsize.c
from 8.0.5.

You might have been irritated by the naming:

relnodeOid = pg_class->relfilenode;
(..)
PG_RETURN_INT64(calculate_relation_size(tblspcOid, relnodeOid));

Regards,
Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Luke Lonergan 2005-12-13 05:31:20 Re: Cost-based optimizers
Previous Message Christopher Kings-Lynne 2005-12-13 04:44:50 Re: Cost-based optimizers