I found another detail :
All access to oper_juntor table is blocked, like it's always locked.
bxs=# select * from oper_juntor;
<<here I need to send a Ctrl + C or I'll wait forever>>
Cancel request sent
ERROR: Query cancel requested while waiting lock
bxs=#
The only non-usual aspect of this table is the atualization throught a
pl/pgsql function. Is it possible to a function make a non-authorized lock
in a table or something like that?
This problem was happening in Postgres 7.0.2. I've changed to 7.0.3 and it's
still happening.
CREATE FUNCTION insere_topologia(int4, int4, int4, int4, int4) RETURNS int4
AS
'
DECLARE
pbxs ALIAS FOR $1;
peg ALIAS FOR $2;
plink ALIAS FOR $3;
pijuntor ALIAS FOR $4;
pfjuntor ALIAS FOR $5;
I int4;
nrows record;
BEGIN
I := pijuntor;
WHILE I <= pfjuntor LOOP
SELECT *
INTO nrows
FROM oper_juntor
WHERE cod_bxs = pbxs AND
cod_juntor = I;
IF FOUND THEN
UPDATE oper_juntor
SET cod_eg = peg,
cod_link = plink
WHERE cod_bxs = pbxs AND
cod_juntor = I;
ELSE
INSERT INTO oper_juntor (cod_bxs, cod_eg, cod_link, cod_juntor)
VALUES (pbxs, peg, plink, I);
END IF;
I := I + 1;
END LOOP;
RETURN 0;
END;
'
LANGUAGE 'plpgsql';
Greetings,
José Vilson de Mello de Farias.
Dígitro Tecnologia Ltda. - Brazil