Re: [Fwd: Re: haven't forgotten about you...]

From: Tim Perdue <tperdue(at)valinux(dot)com>
To: Ben Adida <ben(at)openforce(dot)net>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [Fwd: Re: haven't forgotten about you...]
Date: 2000-08-11 04:13:52
Message-ID: 39937D80.9E7B87E7@valinux.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ben Adida wrote:
> begin transaction
> select balance from accounts where account_id=2 for update
>
> will select the balance and lock the row for account #2
> You can then perform some math on the balance, and do something like:
>
> update accounts set balance= $new_balance where account_id=2
> end transaction
>

Great - I assume end transaction is going to do a commit. If you don't
do an end transaction and you don't issue a rollback... I assume it
rolls back?

This is pretty slick - over the last month or so I've come up with about
8 different places where I really wish I had transactions/rollbacks on
SourceForge. Also running into lots of places where I really, really
wish I had fscking subselects...

Tim

--
Founder - PHPBuilder.com / Geocrawler.com
Lead Developer - SourceForge
VA Linux Systems
408-542-5723

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Don Baccus 2000-08-11 04:34:50 Re: [Fwd: Re: haven't forgotten about you...]
Previous Message Tim Perdue 2000-08-11 03:36:14 [Fwd: Re: haven't forgotten about you...]