Re: How to create trigger if it does not exist

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to create trigger if it does not exist
Date: 2007-05-26 20:22:44
Message-ID: 1180210964.891975.182480@q66g2000hsg.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrus ha escrito:
> CREATE TRIGGER mycheck_trigger BEFORE INSERT OR UPDATE ON mytbl
> FOR EACH ROW EXECUTE PROCEDURE mycheck_pkey();
>
> aborts transaction if trigger already exists.
>
> There in no CREATE OR REPLACE TRIGGER command in PostgreSQL
>
> How to create trigger only when it does not exist ?
>
> Andrus.

DROP TRIGGER IF EXISTS...

See:

http://www.postgresql.org/docs/8.2/static/sql-droptrigger.html

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2007-05-26 22:58:19 Re: How to create trigger if it does not exist
Previous Message Richard P. Welty 2007-05-26 19:21:03 Re: backup strategies