Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] It sorta works, but I'm confused about locking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Massimo Dal Zotto <dz(at)cs(dot)unitn(dot)it>
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL Hackers)
Subject: Re: [HACKERS] It sorta works, but I'm confused about locking
Date: 1998-09-28 18:09:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Massimo Dal Zotto <dz(at)cs(dot)unitn(dot)it> writes:
>> it's not at all clear whether I should call RelationUnsetLockForWrite
>> at the end of the routine or not; some existing code does, some doesn't.

> It is not done where there is an immediate CommitTransactionCommand which
> already releases the locks.

Hmm.  OK, but I guess I don't really understand why it's ever valid to
release a lock before the end of the transaction --- and
CommitTransactionCommand isn't necessarily the end of the transaction
anyway, if you're inside a transaction block.

Basically: it seems to me it's a bug to call UnsetLock (any flavor)
from *anywhere* except transaction commit.  If this is not so, why not?

			regards, tom lane

pgsql-hackers by date

Next:From: Tom LaneDate: 1998-09-28 19:15:06
Subject: Re: [HACKERS] Think we need major revisions in async.c...
Previous:From: Tom LaneDate: 1998-09-28 18:03:31
Subject: Re: [HACKERS] Proper cleanup at backend exit

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group