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:55:12
Message-ID: 439D9D60.1070101@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:
>
>>Tom Lane wrote:
>>
>>>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.
>
>
> That's only possible if Slony is taking AccessExclusive lock; if so,
> your gripe is properly directed to the Slony folks, not to
> pg_relation_size which is acting as a good database citizen should.

More precisely, it executes TRUNCATE;COPY at the same time; there might
be additional locks to prevent using the table. Still, I see no reason
why pg_relation_size shouldn't continue to use SearchSysCache as id did
for years now. There's no sense in using locking mechanisms on table foo
while reading file system data; pg_class is sufficient to locate the
table's files.

Regards,
Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-12-12 15:55:55 Re: Different length lines in COPY CSV
Previous Message Tom Lane 2005-12-12 15:45:04 Re: pg_relation_size locking