RE: User locks code

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'Lincoln Yeoh'" <lyeoh(at)pop(dot)jaring(dot)my>, Rod Taylor <rod(dot)taylor(at)inquent(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: RE: User locks code
Date: 2001-08-21 16:56:19
Message-ID: 3705826352029646A3E91C53F7189E32016746@sectorbase2.sectorbase.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> yep:
> lock "tablename.colname.val=1"
> select count(*) from tablename where colname=1
> If no rows, insert, else update.
> (dunno if the locks would scale to a scenario with hundreds
> of concurrent inserts - how many user locks max?).

I don't see problem here - just a few bytes in shmem for
key. Auxiliary table would keep refcounters for keys.

> Why wouldn't it work with serializable isolevel?

Because of selects see old database snapshot and so you
wouldn't see key inserted+committed by concurrent tx.

Vadim

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Serguei Mokhov 2001-08-21 16:59:24 List response time...
Previous Message J Smith 2001-08-21 16:53:40 Re: Link to bug webpage / Bugzilla?