Re: pg_relation_size locking

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_relation_size locking
Date: 2005-12-12 15:27:04
Message-ID: 439D96C8.6090405@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andreas Pflug <pgadmin(at)pse-consulting(dot)de> writes:
>
>>Until recently, pg_relation_size used SearchSysCache to locate the
>>relation to examine, and calculated the file location from that
>>information. Starting with dbsize.c V1.5 (committed after Beta2),
>>relation_open(.., AccessShareLock) is used. This is very unfortunate
>>because it will not allow to observe a table growing while it is
>>populated, e.g. with a lengthy COPY; pg_relation_size will be blocked.
>
>
> Nonsense.

Ahem.

I'm running Slony against a big replication set. While slon runs COPY
foo(colnamelist) FROM STDIN, I can't execute pg_relation_size(foo_oid).
pg_locks will show that the AccessShareLock on foo is not granted.

Problem is gone with reverted dbsize.c

Regards,
Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-12 15:45:04 Re: pg_relation_size locking
Previous Message Tom Lane 2005-12-12 15:23:19 Re: pg_relation_size locking