vacuumdb locked - part II - Mailing list pgsql-general

From Vilson farias
Subject vacuumdb locked - part II
Date
Msg-id 003a01c0b0af$539f7b60$98a0a8c0@dti.digitro.com.br
Whole thread Raw
List pgsql-general
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


pgsql-general by date:

Previous
From: Marek PUBLICEWICZ
Date:
Subject: pg_dump problem
Next
From: Marek PUBLICEWICZ
Date:
Subject: pg_dump problem