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)