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.