Vacuum from within a function crashes backend - Mailing list pgsql-hackers

From Magnus Naeslund(f)
Subject Vacuum from within a function crashes backend
Date
Msg-id 14c001c266ff$ff953f60$f80c0a0a@mnd
Whole thread Raw
Responses Re: Vacuum from within a function crashes backend  (Alvaro Herrera <alvherre@atentus.com>)
List pgsql-hackers
Hello,

I did a vacuum from within a function, and it went sig11 on me.
Is it illegal to do that?

The function:

drop function xorder1_cleanup();
create function xorder1_cleanup() RETURNS integer AS '
declarex record;c integer;
begin  c:=0;  FOR x IN SELECT order_id,count(*) as cnt FROM xorder1_updates group by order_id LOOP    if x.cnt > 1 then
    c:=c+x.cnt;         delete from xorder1_updates where order_id = x.order_id;      insert into
xorder1_updates(order_id)values (x.order_id);    end if;  END LOOP;  execute ''vacuum full analyse xorder1_updates;'';
returnc; 
end;
' LANGUAGE 'plpgsql';


Magnus

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Programmer/Networker [|] Magnus Naeslund
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


pgsql-hackers by date:

Previous
From: Justin Clift
Date:
Subject: Re: How to REINDEX in high volume environments?
Next
From: Alvaro Herrera
Date:
Subject: Re: How to REINDEX in high volume environments?