Re: can't CREATE TRIGGER - Mailing list pgsql-general

From Michael Fuhr
Subject Re: can't CREATE TRIGGER
Date
Msg-id 20070122034120.GA61976@winnie.fuhr.org
Whole thread Raw
In response to can't CREATE TRIGGER  (gustavo halperin <ggh.develop@gmail.com>)
List pgsql-general
On Mon, Jan 22, 2007 at 12:21:48AM +0200, gustavo halperin wrote:
> I can't create triggers, when I call for example:
> ficha=> CREATE TRIGGER TRG_persons_id AFTER INSERT ON ficha_ofperson
> ficha-> EXECUTE PROCEDURE add_person_id ( 'family_id', 'person_id' );
>
> , the creation never finish and finally, after many minutes, I kill the
> creation with Ctrl+c.

You probably have an open transaction with a lock on ficha_ofperson,
so the CREATE TRIGGER statement blocks until that lock is released.
Query pg_locks to see what transaction that is.  Make sure your
applications don't keep transactions open longer than necessary.

--
Michael Fuhr

pgsql-general by date:

Previous
From: "Jaime Casanova"
Date:
Subject: Re: can't CREATE TRIGGER
Next
From: Chris
Date:
Subject: Re: help me to solve the problem