
> I am working on eliminating the "relation NNN modified while in use"
> misfeature by instead grabbing a lock on each relation at first use
> in a statement, and holding that lock till end of transaction. 

As anticipated, I object :-) 
If you do this you will most likely add the code to the wrong places, 
since what we really need is a lock for the duration of one statement only.

Otherwise you will only fix this situation for those cases where the application 
is actually inside a transaction. And this is (and hopefully stays) not mandatory. 

Additionally we would have the discussed lockout of admin tasks ...

Andreas

Tue, 7 Nov 2000 17:42:56 +0100 
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
AW: Issue NOTICE for attempt to raise lock level?
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
>> I am working on eliminating the "relation NNN modified while in use"
>> misfeature by instead grabbing a lock on each relation at first use
>> in a statement, and holding that lock till end of transaction. 

> As anticipated, I object :-) 

Your objection is founded on two misunderstandings.  In the first place,
we are *always* inside a transaction when executing a query.  It may be
an implicit one-statement transaction, but it's still a transaction.
In the second place, we already grab locks that we do not release till
end of xact for all user-level queries.  The problem is that we grab
them too late, ie, in the executor.  I'm just planning to move up the
grab till first use.

			regards, tom lane

Tue, 07 Nov 2000 12:05:57 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: AW: Issue NOTICE for attempt to raise lock level? 