Re: ACCESS EXCLUSIVE LOCK

From: seth(dot)m(dot)green(at)gmail(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ACCESS EXCLUSIVE LOCK
Date: 2006-03-02 13:55:10
Message-ID: 1141307710.506042.246170@t39g2000cwt.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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_table() that is run from
within update_my_cache() and it does not cause locks. So it seems
something else about the update_my_cache() SP is causing this access
exclusive lock which prevents anything from even dirty reading the
table for the entire time it executes (roughly 10 seconds);

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew - Supernews 2006-03-02 14:07:14 Re: ACCESS EXCLUSIVE LOCK
Previous Message Alvaro Herrera 2006-03-02 13:43:23 Re: ACCESS EXCLUSIVE LOCK

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew - Supernews 2006-03-02 14:07:14 Re: ACCESS EXCLUSIVE LOCK
Previous Message Alvaro Herrera 2006-03-02 13:43:23 Re: ACCESS EXCLUSIVE LOCK