Re: can't CREATE TRIGGER

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: gustavo halperin <ggh(dot)develop(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: can't CREATE TRIGGER
Date: 2007-01-22 03:41:21
Message-ID: 20070122034120.GA61976@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris 2007-01-22 03:47:28 Re: help me to solve the problem
Previous Message Jaime Casanova 2007-01-22 03:38:05 Re: can't CREATE TRIGGER