[HACKERS] Re: Good name for new lock type for VACUUM?

2001-06-21 Thread Thomas Swan

Tom Lane wrote:

Awhile ago I said that I wanted to create a new flavor of table-level
lock for concurrent VACUUM to get on a table.  RowExclusiveLock is
not the right thing because it is not self-exclusive, whereas we don't
want more than one VACUUM mangling a table at a time.  But anything
higher locks out concurrent writers, which we don't want either.
So we need an intermediate lock type that will conflict with itself
as well as with ShareLock and above.  (It must conflict with ShareLock
since we don't want new indexes being created during VACUUM either...)

*snip*


BTW, I'm assuming that I should make the new lock type available
at the user level as a LOCK TABLE option.  Any objections to that?

I think that type of lock would best be kept to the system level.  

*thinking out loud*
If your goal is to have it used more often, then user level might 
provide more opportunities for testing.  However, I can't really think 
of any situation where it would be beneficial to a user.  The rest of 
the locks seem to take care of everything else.

Is it going to timeout?  If a connection is dropped by a user, will the 
lock release?



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



Re: [HACKERS] Re: Good name for new lock type for VACUUM?

2001-06-21 Thread Tom Lane

Thomas Swan [EMAIL PROTECTED] writes:
 I think that type of lock would best be kept to the system level.  

Why?

I don't have a scenario offhand where it'd be useful, but if we've
discovered it's useful for VACUUM then there may be cases where a lock
with these properties would be useful to users as well.  Besides, we
have several lock types that are exposed to users even though we've
found no uses for them at the system level.

 Is it going to timeout?  If a connection is dropped by a user, will the 
 lock release?

No, and yes, same as any other lock.

regards, tom lane

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html