AW: [HACKERS] timeout on lock feature

2001-04-19 Thread Zeugswetter Andreas SB
> > > The only way PG could apply reasonable timeouts would be for the > > > application to dictate them, > > > > That is exactly what we are talking about here. > > No. You wrote elsewhere that the application sets "30 seconds" and > leaves it. But that 30 seconds doesn't have any applicat

Re: [HACKERS] timeout on lock feature

2001-04-18 Thread Nathan Myers
On Wed, Apr 18, 2001 at 09:39:39PM -0400, Bruce Momjian wrote: > > On Wed, Apr 18, 2001 at 07:33:24PM -0400, Bruce Momjian wrote: > > > > What might be a reasonable alternative would be a BEGIN timeout: > > > > report failure as soon as possible after N seconds unless the > > > > timer is reset, s

Re: [HACKERS] timeout on lock feature

2001-04-18 Thread Bruce Momjian
> On Wed, Apr 18, 2001 at 07:33:24PM -0400, Bruce Momjian wrote: > > > What might be a reasonable alternative would be a BEGIN timeout: report > > > failure as soon as possible after N seconds unless the timer is reset, > > > such as by a commit. Such a timeout would be meaningful at the > > >

Re: [HACKERS] timeout on lock feature

2001-04-18 Thread Nathan Myers
On Wed, Apr 18, 2001 at 07:33:24PM -0400, Bruce Momjian wrote: > > What might be a reasonable alternative would be a BEGIN timeout: report > > failure as soon as possible after N seconds unless the timer is reset, > > such as by a commit. Such a timeout would be meaningful at the > > database-

Re: [HACKERS] timeout on lock featurey

2001-04-18 Thread Bruce Momjian
> What might be a reasonable alternative would be a BEGIN timeout: report > failure as soon as possible after N seconds unless the timer is reset, > such as by a commit. Such a timeout would be meaningful at the > database-interface level. It could serve as a useful building block > for appl

Re: [HACKERS] timeout on lock feature

2001-04-18 Thread Nathan Myers
On Wed, Apr 18, 2001 at 09:54:11AM +0200, Zeugswetter Andreas SB wrote: > > > In short, I think lock timeout is a solution searching in vain for a > > > problem. If we implement it, we are just encouraging bad application > > > design. > > > > I agree with Tom completely here. > > > > In any re

Re: AW: [HACKERS] timeout on lock featurey

2001-04-18 Thread Bruce Momjian
[ Charset ISO-8859-1 unsupported, converting... ] > > One idea Tom had was to make it only active in a transaction, > > so you do: > > > > BEGIN WORK; > > SET TIMEOUT TO 10; > > UPDATE tab SET col = 3; > > COMMIT > > > > Tom is concerned people will do the SET and forget to RESE

Re: AW: [HACKERS] timeout on lock feature

2001-04-18 Thread Bruce Momjian
[ Charset ISO-8859-1 unsupported, converting... ] > > This is the real reason why I've been holding out for restricting the > > feature to a specific LOCK TABLE statement: if it's designed that way, > > at least you know which lock you are applying the timeout to, and have > > some chance of being

RE: AW: [HACKERS] timeout on lock feature

2001-04-18 Thread Mikheev, Vadim
> One idea Tom had was to make it only active in a transaction, > so you do: > > BEGIN WORK; > SET TIMEOUT TO 10; > UPDATE tab SET col = 3; > COMMIT > > Tom is concerned people will do the SET and forget to RESET > it, causing all queries to be affected by the timeout.

RE: AW: [HACKERS] timeout on lock feature

2001-04-18 Thread Mikheev, Vadim
> This is the real reason why I've been holding out for restricting the > feature to a specific LOCK TABLE statement: if it's designed that way, > at least you know which lock you are applying the timeout to, and have > some chance of being able to estimate an appropriate timeout. As I pointed be

AW: AW: [HACKERS] timeout on lock feature

2001-04-18 Thread Zeugswetter Andreas SB
> > It is not something that makes anything unrelyable or less robust. > > How can you argue that? The presence of a lock timeout *will* make > operations fail that otherwise would have succeeded; moreover that > failure will be pretty unpredictable (at least from the point of view > of the app

Re: AW: [HACKERS] timeout on lock feature

2001-04-18 Thread Tom Lane
Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > It is not something that makes anything unrelyable or less robust. How can you argue that? The presence of a lock timeout *will* make operations fail that otherwise would have succeeded; moreover that failure will be pretty unpredictable (at

AW: [HACKERS] timeout on lock feature

2001-04-18 Thread Zeugswetter Andreas SB
> > In short, I think lock timeout is a solution searching in vain for a > > problem. If we implement it, we are just encouraging bad > application > > design. > > I agree with Tom completely here. > > In any real-world application the database is the key component of a > larger system: the w

Re: [HACKERS] timeout on lock feature

2001-04-17 Thread Theo Kramer
> Timeouts are a system-level mechanism that to be useful must refer to > system-level events that are far above anything that PG knows about. > The only way PG could apply reasonable timeouts would be for the > application to dictate them, but the application can better implement > them itse

Re: [HACKERS] timeout on lock feature

2001-04-17 Thread Nathan Myers
On Tue, Apr 17, 2001 at 12:56:11PM -0400, Tom Lane wrote: > In short, I think lock timeout is a solution searching in vain for a > problem. If we implement it, we are just encouraging bad application > design. I agree with Tom completely here. In any real-world application the database is the k

RE: AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Mikheev, Vadim
> > The timeout will be useful to let the client or user decide > > on an alternate course of action other that killing his > > application (without the need for timers or threads in the > > client program). > > This assumes (without evidence) that the client has a good > idea of what the timeout

RE: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Mikheev, Vadim
> > Added to TODO: > > * Add SET parameter to timeout if waiting for lock too long > > I repeat my strong objection to any global (ie, affecting all locks) > timeout. Such a "feature" will have unpleasant consequences. But LOCK TABLE T IN ROW EXCLUSIVE MODE WITH TIMEOUT X will not give requ

Re: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Tom Lane
Michael Ansley <[EMAIL PROTECTED]> writes: > Sorry for my forgetfulness (and a search through geocrawler didn't turn up > anything useful), but what was the problem with something like NOWAIT? > e.g.: SELECT * FROM a FOR UPDATE NOWAIT; > where, if the required lock could not be obtained immediatel

RE: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Michael Ansley
Title: RE: AW: [HACKERS] timeout on lock feature Sorry for my forgetfulness (and a search through geocrawler didn't turn up anything useful), but what was the problem with something like NOWAIT? e.g.: SELECT * FROM a FOR UPDATE NOWAIT; where, if the required lock could not be obt

AW: AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Zeugswetter Andreas SB
> > The timeout will be useful to let the client or user decide on an > > alternate course of action other that killing his application (without > > the need for timers or threads in the client program). > > This assumes (without evidence) that the client has a good idea of what > the timeout li

Re: AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Tom Lane
Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > The timeout will be useful to let the client or user decide on an > alternate course of action other that killing his application (without > the need for timers or threads in the client program). This assumes (without evidence) that the client

Re: AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Tom Lane
Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes: > The timeout will be useful to let the client or user decide on an > alternate course of action other that killing his application (without > the need for timers or threads in the client program). Okay, let's take a close look at this assumptio

AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Zeugswetter Andreas SB
> > Added to TODO: > > * Add SET parameter to timeout if waiting for lock too long > > I repeat my strong objection to any global (ie, affecting all locks) > timeout. Such a "feature" will have unpleasant consequences. Except that other people like myself, see those consequences as a plea

AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Zeugswetter Andreas SB
> > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > Added to TODO: > > > * Add SET parameter to timeout if waiting for lock too long > > > > I repeat my strong objection to any global (ie, affecting all locks) > > timeout. Such a "feature" will have unpleasant consequences. > > I envisioned:

Re: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I envisioned: > SET TIMEOUT TO 10; > UPDATE tab SET col = 3; > RESET TIMEOUT > Can't we get that work work properly? Let the timeout only apply to the > 'tab' table and none of the others. As Henryk has implemented it, it WON'T only

Re: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Added to TODO: > * Add SET parameter to timeout if waiting for lock too long I repeat my strong objection to any global (ie, affecting all locks) timeout. Such a "feature" will have unpleasant consequences. regards, tom l

AW: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Zeugswetter Andreas SB
> > I envisioned: > > > SET TIMEOUT TO 10; > > UPDATE tab SET col = 3; > > RESET TIMEOUT > > > Can't we get that work work properly? Let the timeout only > apply to the > > 'tab' table and none of the others. > > As Henryk has implemented it, it WON'T only apply to the 'tab' tabl

Re: AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Bruce Momjian
Added to TODO: * Add SET parameter to timeout if waiting for lock too long > > > I was thinking SET because UPDATE does an auto-lock. > > Optimal would imho be a SET that gives a maximum amount of time in seconds > the client is willing to wait for any lock. But I

AW: [HACKERS] timeout on lock feature

2001-04-17 Thread Zeugswetter Andreas SB
> I was thinking SET because UPDATE does an auto-lock. Optimal would imho be a SET that gives a maximum amount of time in seconds the client is willing to wait for any lock. But I liked the efficiency of Henryk's code. > > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > I can imagine some

Re: [HACKERS] timeout on lock feature

2001-04-13 Thread Bruce Momjian
> The appropriate way to do this given a LOCK TABLE option would be like > > BEGIN; > LOCK TABLE foo IN ROW EXCLUSIVE MODE WITH TIMEOUT n; > UPDATE foo SET ...; > COMMIT; > > which restricts the scope of the timeout behavior to just the specific > lock that the user is th

Re: [HACKERS] timeout on lock feature

2001-04-13 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I was thinking SET because UPDATE does an auto-lock. Not to mention a ton of implicit locks acquired on various system tables during parsing/planning. You really want auto timeout on all of those? I sure don't. The appropriate way to do this given a L

Re: [HACKERS] timeout on lock feature

2001-04-13 Thread Bruce Momjian
I was thinking SET because UPDATE does an auto-lock. > Bruce Momjian <[EMAIL PROTECTED]> writes: > > I can imagine some people wanting this. However, 7.1 has new deadlock > > detection code, so I would you make a 7.1 version and send it over. We > > can get it into 7.2. > > I object strongly

Re: [HACKERS] timeout on lock feature

2001-04-13 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I can imagine some people wanting this. However, 7.1 has new deadlock > detection code, so I would you make a 7.1 version and send it over. We > can get it into 7.2. I object strongly to any such "feature" in the low-level form that Henryk proposes, b

Re: [HACKERS] timeout on lock feature

2001-04-09 Thread Bruce Momjian
I can imagine some people wanting this. However, 7.1 has new deadlock detection code, so I would you make a 7.1 version and send it over. We can get it into 7.2. I think we need a SET variable, and it should default to OFF. Good idea. Thanks. > Hi, > > I implement additional server functio

Re: [HACKERS] timeout on lock feature

2001-04-09 Thread Bruce Momjian
If you can't handle the SET variable stuff, we can do it over here. Thanks. > Hi, > > I implement additional server functionality. Currently (v7.0.3), executing > SQL update statement on the same > row from inside two different processess results in blocking second process > to the end of tran

[HACKERS] timeout on lock feature

2001-04-09 Thread Henryk Szal
Hi, I implement additional server functionality. Currently (v7.0.3), executing SQL update statement on the same row from inside two different processess results in blocking second process to the end of transaction in the first one. In real OLTP application second process can't wait too long. Afte

[HACKERS] timeout on lock

2001-04-09 Thread Henryk Szal
Hi, i implement additional server functionality. Currently (v7.0.3), executing SQL update statement on the same row from inside two different processess results in blocking second process to the end of transaction in the first one. In real OLTP application second process can't wait too long. Afte