Re: Help with inventory control - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Help with inventory control
Date
Msg-id 20050930154143.GA29738@svana.org
Whole thread Raw
In response to Help with inventory control  (Fernando Grijalba <fgrijalba@gmail.com>)
Responses Re: Help with inventory control
List pgsql-general
On Fri, Sep 30, 2005 at 10:21:14AM -0400, Fernando Grijalba wrote:
> I need the following to work with PostgreSQL. I was thinking of reading
> uncommitted transactions, but just found out they do not work on PG. I need
> to have user 1 take an item form inventory for an order and before user 1
> finishes the transaction user 2 will query the inventory. I need user 2 to
> see the quantity on-hand reduced by the amount user 1 took.

Why not just commit user 1's transaction then user 2 can see it.
Transactions should only be open for fractions of seconds in the
situation you're describing. You're not rewriting the whole database
here.

> Because read uncommitted is not supported is there a way to do this?

Read Uncommitted goes against the very nature of a database...
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Doug Bloebaum
Date:
Subject: Re: Get all table names that have a specific column
Next
From: Scott Marlowe
Date:
Subject: Re: security documentation