Tom,
Yes, I understand locking the table, but empirically, two index
creations will not run simultaneously on the same table. So if
I start (and background) two
psql -c "create index one on mytable . . ." database
psql -c "create index two on mytable . . ." database
commands. The first one starts and the second one waits until the
first is finished (as tracked by "ps avx" or "top").
--Martin
Tom Lane wrote on Mon, 22 Oct 2001 23:09:26 EDT
>Martin Weinberg <weinberg@osprey.astro.umass.edu> writes:
>> On Postgresql 7.1.3, it seems that the table is locked after the
>> first "create index" is started up. Is this right?
>
>AFAIK it's a share lock, which only prohibits modifications to the
>table, not reads (nor concurrent index builds). Not sure how you
>expect the system to do better than that.
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>