Re: pg_relation_size locking - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: pg_relation_size locking
Date
Msg-id 439D96C8.6090405@pse-consulting.de
Whole thread Raw
In response to Re: pg_relation_size locking  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_relation_size locking  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Andreas Pflug <pgadmin@pse-consulting.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_relation_size locking
Next
From: Tom Lane
Date:
Subject: Re: pg_relation_size locking