Re: [GENERAL] TRUNCATE locking problem

2005-07-21 Thread Joe Maldonado
Tom Lane wrote: Joe Maldonado <[EMAIL PROTECTED]> writes: While researching this locking issue I got some of the logs and found that in one of the cases there was a SELECT running for a long time, about 2 hours. This select statement does not usually take more than a few seconds though, i

Re: [GENERAL] TRUNCATE locking problem

2005-07-21 Thread Tom Lane
Joe Maldonado <[EMAIL PROTECTED]> writes: > While researching this locking issue I got some of the logs and found > that in one of the cases there was a SELECT running for a long time, > about 2 hours. This select statement does not usually take more than a > few seconds though, it appeared tha

Re: [GENERAL] TRUNCATE locking problem

2005-07-21 Thread Joe Maldonado
Hello all again... While researching this locking issue I got some of the logs and found that in one of the cases there was a SELECT running for a long time, about 2 hours. This select statement does not usually take more than a few seconds though, it appeared that TRUNCATE was waiting on it

Re: [GENERAL] TRUNCATE locking problem

2005-07-18 Thread Joe Maldonado
Thanks...I just wanted to verify that it was the intended behaviour prior to going in and changing code :) - Joe Maldonado Tom Lane wrote: Joe Maldonado <[EMAIL PROTECTED]> writes: It seems that TRUNCATE is first posting a lock on the table and then waiting for other transactions to finis

Re: [GENERAL] TRUNCATE locking problem

2005-07-18 Thread Tom Lane
Joe Maldonado <[EMAIL PROTECTED]> writes: > It seems that TRUNCATE is first posting a lock on the table and then > waiting for other transactions to finish before truncating the table > thus blocking all other operations. That's what it's supposed to do. If you have a problem with the length of

Re: [GENERAL] TRUNCATE locking problem

2005-07-18 Thread Stephen Frost
* Joe Maldonado ([EMAIL PROTECTED]) wrote: > It seems that TRUNCATE is first posting a lock on the table and then > waiting for other transactions to finish before truncating the table > thus blocking all other operations. > > Is this what is actually going on or am I missing something else? and

[GENERAL] TRUNCATE locking problem

2005-07-18 Thread Joe Maldonado
Hello all, We am running PostgreSQL 7.4.5 and recently we have noticed some strange behaviour with regards to the TRUNCATE statement. I think it would help to provide a quick overview of what we are doing with the table in question in order to properly explain this. The application which ar