Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: <fabriziomello(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );
Date: 2015-03-30 22:41:42
Message-ID: 5519D126.9050104@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/27/15 2:23 PM, Fabrízio de Royes Mello wrote:
> Hi all,
>
> I'm tweaking some autovacuum settings in a table with high write usage
> but with ALTER TABLE .. SET ( .. ) this task was impossible, so I did a
> catalog update (pg_class) to change reloptions.
>
> Maybe it's a stupid doubt, but why we need to get an AccessExclusiveLock
> on relation to set reloptions if we just touch in pg_class tuples
> (RowExclusiveLock) ?

For a very long time catalog access was not MVCC safe. I think that's
been changed, so at this point it may be OK to relax the lock, at least
in the case of autovac settings. There may well be other settings in
there where it would not be safe.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2015-03-30 22:42:18 Re: Bug fix for missing years in make_date()
Previous Message Jim Nasby 2015-03-30 22:39:04 Re: Implementing a join algorithm in Postgres