Thread: Question about alter table rename

Question about alter table rename

From
Garry Chen
Date:

Hi all,

                For Postgresl release 10 an access exclusive lock is held when an alter table rename was performing.  Does it prohibit a select operation against the table?

 

Thank you very much,

Garry

Re: Question about alter table rename

From
"David G. Johnston"
Date:
On Mon, Dec 11, 2017 at 8:54 AM, Garry Chen <gc92@cornell.edu> wrote:

Hi all,

                For Postgresl release 10 an access exclusive lock is held when an alter table rename was performing.  Does it prohibit a select operation against the table?


ACCESS EXCLUSIVE
Conflicts with locks of all modes (ACCESS SHARE, ROW SHARE, ROW EXCLUSIVE, SHARE UPDATE EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE, EXCLUSIVE, and ACCESS EXCLUSIVE). This mode guarantees that the holder is the only transaction accessing the table in any way.

ACCESS SHARE
Conflicts with the ACCESS EXCLUSIVE lock mode only.
The SELECT command acquires a lock of this mode on referenced tables. In general, any query that only reads a table and does not modify it will acquire this lock mode.

David J.