triggers, transactions and locks

Поиск
Список
Период
Сортировка
От C G
Тема triggers, transactions and locks
Дата
Msg-id BAY101-F376F54422B0A105BB6D943C5B40@phx.gbl
обсуждение исходный текст
Ответы Re: triggers, transactions and locks
Список pgsql-general
Dear All,

Is there a way to use locks within a trigger? My example below gives the
error:
ERROR:  unexpected error -8 in EXECUTE of query "BEGIN"
CONTEXT:  PL/pgSQL function "insert_into_t1" line 6 at execute statement

Thanks

Colin


CREATE FUNCTION insert_into_t1() RETURNS trigger AS'
        DECLARE
                set_qry text;
        BEGIN

                set_qry:=''BEGIN WORK'';
                execute set_qry;
                LOCK t1;
                INSERT INTO t2 VALUES (11);
                COMMIT;
                RETURN NEW;
        END;
' LANGUAGE 'plpgsql' SECURITY DEFINER;

CREATE TRIGGER insert_into_t1 BEFORE INSERT
        ON t1 FOR EACH ROW EXECUTE
                PROCEDURE insert_into_t1();



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: select single entry and its neighbours using direct-acess to index?
Следующее
От: Pierre-Frédéric Caillaud
Дата:
Сообщение: Re: select single entry and its neighbours using direct-acess to index?