Transaction problem - Mailing list pgsql-general

From x asasaxax
Subject Transaction problem
Date
Msg-id 91495cb0712031027l78cc35a3gcb86ce5a99078622@mail.gmail.com
Whole thread Raw
Responses Re: Transaction problem
Re: Transaction problem
List pgsql-general
Hi everyone,

   I would like to know how can i do a simple transaction for this situation:

I have n products in certain row of a table. When the user buys a product,  the quantity of this product will be decreased. The user can only buy a product that has a quantity n > 0. This means that when the user send the product confirmation to the system, the bd will decrease the product quantity with a transaction if the number of product in stock is greater than zero.


Did anyone knows how can i do that with postgre?

Thanks a lot.

pgsql-general by date:

Previous
From: brian
Date:
Subject: Re: initdb - encoding question
Next
From: "Scott Marlowe"
Date:
Subject: Re: Transaction problem