From: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: [ADMIN] Deadlock on transaction
Date: Mon, 12 Feb 2007 16:27:15 -0300
Message-ID: <55c095e90702121127rf7daaebodf2efe1a5e1d2dcd@mail.gmail.com> (raw)
In-Reply-To: <20070212185919.GG677@spoetnik.xs4all.nl>
References: <55c095e90702120943v2909044eo91445b0eda3958c7@mail.gmail.com>
<1171302488.3565.15.camel@state.g2switchworks.com>
<55c095e90702121008u6d3d27c0m16e52d63f97c3e7d@mail.gmail.com>
<20070212185919.GG677@spoetnik.xs4all.nl>
Ok you teach me. Thank you and sorry. :(
I just want to know why is it occuring. I am pretty sad.
Ezequias
2007/2/12, Reinoud van Leeuwen <reinoud.v@n.leeuwen.net>:
>
> On Mon, Feb 12, 2007 at 03:08:27PM -0300, Ezequias Rodrigues da Rocha
> wrote:
> > I mean really deadlock. Other transactions can't access the database
> until
> > the main transaction is complete.
>
> What you describe sounds like a blocking lock: one transaction uses a
> resource and another has to wait until it is not locked anymore
>
> A deadlock is a special case: two transactions both need resources A and
> B. transaction 1 locks A, and the next moment transaction 2 locks B. Now
> transaction 1 waits for 2 to release B, but at the same time 2 waits for 1
> to release A. This is called a deadlock, or circulair lock.
> Postgresql automatically detects such a situation and rolls one of them
> back. The client recieves a 'restartable database error' and that is
> exactly true: ususally another try will work.
>
> One method of fixing deadlocks is to make sure all your code accesses the
> database in the same order. Alphabetically is easiest to remember...
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ezequias.rocha@gmail.com
Subject: Re: [ADMIN] Deadlock on transaction
In-Reply-To: <55c095e90702121127rf7daaebodf2efe1a5e1d2dcd@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox