Re: lock table question

From: "Mike Mascari" <mascarm(at)mascari(dot)com>
To: "Andy Kriger" <akriger(at)greaterthanone(dot)com>, "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: lock table question
Date: 2002-12-31 01:13:36
Message-ID: 000f01c2b069$d8e77fa0$0102a8c0@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

----- Original Message -----
From: "Andy Kriger" <akriger(at)greaterthanone(dot)com>
To: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Sent: Monday, December 30, 2002 6:07 PM
Subject: Re: [GENERAL] lock table question

> I agree which is why I'm asking the question. In this case, I'm trying to
> ensure that my inventory quantity is not changed by some other request as
> the first one does a test of availability and then decrements that
> availability.
>
> After various responses, it looks like SELECT...FOR UPDATE does fit the bill
> if I use it consistently for querying the records I'm interested in.
>
> I'm no psql expert, so every day it's something new to add to my toolkit.
> -a

I've found Tom Lane's presentation on concurrency issues a must read:

http://conferences.oreillynet.com/cs/os2002/view/e_sess/2681

It's in a PDF file archived in the .tgz file at the end of the article.

HTH,

Mike Mascari
mascarm(at)mascari(dot)com

> ----
>
> Why?
>
> You're really swimming upstream against the notion of MVCC if you want
> to prevent pure readers from proceeding while your update transaction
> runs. Since you claim to be concerned about bottlenecks, I do not see
> why you shouldn't embrace the MVCC worldview, rather than fighting it
> tooth and nail.
>
> regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wenzhe Zhou 2002-12-31 01:53:25 Postgres run out of disk space
Previous Message Atahualpa Jones 2002-12-31 01:02:31 Postgresql 7.2.1 and umlauts