Skip site navigation (1) Skip section navigation (2)

Re: Lock ACCESS EXCLUSIVE and Select question !

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Lock ACCESS EXCLUSIVE and Select question !
Date: 2011-02-28 22:59:29
Message-ID: 20110228225928.GC80597@shinkuro.com (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, Feb 28, 2011 at 05:39:07PM -0500, Alan Acosta wrote:
> But i have a new problem there, i have no rows for update, i create new rows
> when the seats are sold, cause rarely the database knows the capacity of the
> bus, number of seats, even some bus doesn't have seat number 4 for example
> :p. So i cannot SELECT FOR UPDATE no existent rows, but i still need to lock
> in some way in order to check if seat number X was already sold or is free !

Someone else suggests that you need a uniqueness constraint, and I
agree.  But I also don't understand how you can be ensuring not to
double-sell something if you don't have the list of inventory prior to
its being sold.

A

-- 
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

pgsql-general by date

Next:From: Gary FuDate: 2011-02-28 23:16:14
Subject: Re: slow building index and reference after Sybase to Pg
Previous:From: Andres FreundDate: 2011-02-28 22:56:49
Subject: Re: slow building index and reference after Sybase to Pg

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group