Re: Help with inventory control

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Fernando Grijalba <fgrijalba(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Help with inventory control
Date: 2005-09-30 15:41:44
Message-ID: 20050930154143.GA29738@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2005-09-30 15:48:44 Re: Redhat 9 RPM dependency problem
Previous Message Doug Bloebaum 2005-09-30 15:41:20 Re: Get all table names that have a specific column