Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. ); - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );
Date
Msg-id 20150406035341.GB4369@alvh.no-ip.org
Whole thread Raw
In response to Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Responses Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );
List pgsql-hackers
Fabrízio de Royes Mello wrote:

> Ok guys. The attached patch refactor the reloptions adding a new field
> "lockmode" in "relopt_gen" struct and a new method to determine the
> required lock level from an option list.
> 
> We need determine the appropriate lock level for each reloption:

I don't think AccessShareLock is appropriate for any option change.  You
should be using a lock level that's self-conflicting, as a minimum
requirement, to avoid two processes changing the value concurrently.  (I
would probably go as far as ensuring that the lock level specified in
the table DoLockModesConflict() with itself in an Assert somewhere.)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Upper-case error in docs regarding PQmakeEmptyPGresult
Next
From: Fujii Masao
Date:
Subject: pg_rewind and log messages