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

Поиск
Список
Период
Сортировка
От Tim Perdue
Тема Re: [Fwd: Re: haven't forgotten about you...]
Дата
Msg-id 39937D80.9E7B87E7@valinux.com
обсуждение исходный текст
Ответ на [Fwd: Re: haven't forgotten about you...]  (Tim Perdue <tperdue@valinux.com>)
Ответы Re: [Fwd: Re: haven't forgotten about you...]  (Don Baccus <dhogaza@pacifier.com>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tim Perdue
Дата:
Сообщение: [Fwd: Re: haven't forgotten about you...]
Следующее
От: Don Baccus
Дата:
Сообщение: Re: [Fwd: Re: haven't forgotten about you...]