Re: Why need a lock? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why need a lock?
Date
Msg-id 19380.1695656023@sss.pgh.pa.us
Whole thread Raw
In response to Why need a lock?  (jacktby jacktby <jacktby@gmail.com>)
List pgsql-hackers
jacktby jacktby <jacktby@gmail.com> writes:
> I find this in source code
> #define ShareLock                5    /* CREATE INDEX (WITHOUT CONCURRENTLY) */
> I think if there is no CONCURRENTLY, so why we need a lock, I think that’s unnecessary. What’s the point?

We need a lock precisely to prevent concurrent execution
(of table modifications that would confuse the index build).

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }
Next
From: Joe Conway
Date:
Subject: Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }