Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-05 Thread Jim C. Nasby
On Thu, Mar 02, 2006 at 06:16:00AM -0800, [EMAIL PROTECTED] wrote: > > TRUNCATE is another command that takes an access exclusive lock. > > The whole SP takes about 10 seconds to run total. The TRUNCATE command > only takes less than a second. However, the access exclusive lock is > held through

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-04 Thread seth . m . green
First of all, thank you very much. I changed TRUNCATE to DELETE FROM and my problem as been fixed. Is there any way to override that behavior? I know you can explicitly lock tables, can you explicitly unlock tables? Just to be clear, once I run a TRUNCATE command inside an SP, that table that it

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-04 Thread seth . m . green
> TRUNCATE is another command that takes an access exclusive lock. The whole SP takes about 10 seconds to run total. The TRUNCATE command only takes less than a second. However, the access exclusive lock is held throughout the entire SP, not just during the execution of the TRUNCATE command. Sho

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-04 Thread seth . m . green
No. Here is the offending SP: CREATE OR REPLACE FUNCTION update_my_cache() RETURNS void AS ' BEGIN TRUNCATE TABLE my_cache_table; INSERT INTO my_cache_table SELECT * FROM get_my_stuff_to_fill_cache_table(); RETURN; END ' LANGUAGE plpgsql; I've checked the SP get_my_stuff_to_fill_cache_t

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-03 Thread Michael Fuhr
On Fri, Mar 03, 2006 at 08:47:41PM -0600, Jim C. Nasby wrote: > You have a URL for where in the docs it says that? Sounds like it needs > to be updated to include TRUNCATE. http://www.postgresql.org/docs/7.4/static/explicit-locking.html#LOCKING-TABLES It doesn't say that only the listed commands

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-03 Thread Jim C. Nasby
You have a URL for where in the docs it says that? Sounds like it needs to be updated to include TRUNCATE. On Wed, Mar 01, 2006 at 03:55:26PM -0800, [EMAIL PROTECTED] wrote: > This may be a newbie question, but according to the 7.4 docs, an ACCESS > EXCLUSIVE lock is only acquired by the ALTER TAB

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-02 Thread Andrew - Supernews
On 2006-03-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > First of all, thank you very much. I changed TRUNCATE to DELETE FROM > and my problem as been fixed. > > Is there any way to override that behavior? I know you can explicitly > lock tables, can you explicitly unlock tables? No. > Just

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-02 Thread Andrew - Supernews
On 2006-03-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> TRUNCATE is another command that takes an access exclusive lock. > > The whole SP takes about 10 seconds to run total. The TRUNCATE command > only takes less than a second. However, the access exclusive lock is > held throughout the e

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-02 Thread Andrew - Supernews
On 2006-03-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > No. Here is the offending SP: > > CREATE OR REPLACE FUNCTION update_my_cache() RETURNS void AS ' > BEGIN > > TRUNCATE TABLE my_cache_table; TRUNCATE is another command that takes an access exclusive lock. -- Andrew, Supernews http:

Re: [HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-02 Thread Alvaro Herrera
[EMAIL PROTECTED] wrote: > This may be a newbie question, but according to the 7.4 docs, an ACCESS > EXCLUSIVE lock is only acquired by the ALTER TABLE, DROP TABLE, > REINDEX, CLUSTER, and VACUUM FULL commands. > > However, when viewing pg_locks during the execution of a stored > procedure that do

[HACKERS] ACCESS EXCLUSIVE LOCK

2006-03-02 Thread seth . m . green
This may be a newbie question, but according to the 7.4 docs, an ACCESS EXCLUSIVE lock is only acquired by the ALTER TABLE, DROP TABLE, REINDEX, CLUSTER, and VACUUM FULL commands. However, when viewing pg_locks during the execution of a stored procedure that does not perform any of the above comma