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
> 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
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
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