Why is LockClassinfoForUpdate()'s mark4update a good idea?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Why is LockClassinfoForUpdate()'s mark4update a good idea?
Date: 2001-01-15 22:48:30
Message-ID: 29101.979598910@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Why does LockClassinfoForUpdate() insist on doing heap_mark4update?
As far as I can see, this accomplishes nothing except to break
concurrent index builds. If I do

create index tenk1_s1 on tenk1(stringu1);
create index tenk1_s2 on tenk1(stringu2);

in two psqls at approximately the same time, the second one fails with

ERROR: LockStatsForUpdate couldn't lock relid 274157

which is entirely unnecessary.

I don't believe that the similar code in AlterTableDropColumn()
and AlterTableCreateToastTable() is a good idea either. We do not
depend on "SELECT FOR UPDATE" on pg_class tuples for interlocking
changes to relations; we use exclusive locks on the relations themselves
for that. mark4update is unnecessary in this context.

Comments?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Myers 2001-01-15 23:45:27 Re: CRCs
Previous Message Lamar Owen 2001-01-15 22:32:26 Re: RPMS for 7.1beta3 being uploaded.