pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-interfaces@postgresql.org, Junaili Lie <junaili@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: <IDLE> in transaction
Date: Fri, 19 Aug 2005 23:29:32 -0400
Message-ID: <20050820032932.GA18659@surnet.cl> (raw)
In-Reply-To: <20050820010140.GC5365@varlena.com>
References: <8d04ce990508181616c93fbbc@mail.gmail.com>
	<20050819000218.GS5365@varlena.com>
	<20050819185519.GY5365@varlena.com>
	<20050819230602.GM15622@surnet.cl>
	<20050820010140.GC5365@varlena.com>

On Fri, Aug 19, 2005 at 06:01:40PM -0700, elein wrote:

> To replicate the situation in psql:
> 	BEGIN;
> 	select something;
> 
> In another window I see that I have not only shared access locks
> but an exclusive access lock.  I do not understand why the exclusive
> lock is there.  Am I seeing ghosts?

No, it's the lock on the transaction's own TransactionId.  It's harmless
until the transaction updates a tuple that some other transaction later
wants to update too.  You should be able to see it too if you don't
issue the SELECT.  The point of the modification I was indicating is to
delay the acquisition of such a lock until the transaction actually does
something, like that SELECT.  (So if the client does exactly what you
did, it wouldn't be solved by my proposed change.)

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"In a specialized industrial society, it would be a disaster
to have kids running around loose." (Paul Graham)



view thread (7+ messages)

Message-ID: <20050820032932.GA18659@surnet.cl>
Permalink:  ../20050820032932.GA18659@surnet.cl/
Also on:    postgresql.org/message-id/20050820032932.GA18659@surnet.cl

 · 

reply

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-interfaces@postgresql.org
  Cc: alvherre@alvh.no-ip.org, junaili@gmail.com, pgsql-general@postgresql.org
  Subject: Re: <IDLE> in transaction
  In-Reply-To: <20050820032932.GA18659@surnet.cl>

* 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