>    possible:
>
>        CREATE TRIGGER on_insert AFTER INSERT on emp
>            FOR EACH ROW EXECUTE PROCEDURE on_ins_emp();
>
>        CREATE TRIGGER on_insert AFTER INSERT on payroll
>            FOR EACH ROW EXECUTE PROCEDURE on_ins_payroll();
>
>    The name of the trigger  is  the  same  but  the  table  they
>    triggered  for  differs  and they call different functions.

I think trigger names shoud be unique. Like in Informix, Oracle, DB/2.

Remember to drop a trigger, the syntax usually is:
	drop trigger on_insert;

so you could safely name the function _trig_<triggername> e.g.

Andreas


Fri, 14 Aug 1998 11:06:07 +0200
Andreas Zeugswetter <andreas.zeugswetter@telecom.at>
Re: [HACKERS] Rule system (trigger names)
> 
> >    possible:
> >
> >        CREATE TRIGGER on_insert AFTER INSERT on emp
> >            FOR EACH ROW EXECUTE PROCEDURE on_ins_emp();
> >
> >        CREATE TRIGGER on_insert AFTER INSERT on payroll
> >            FOR EACH ROW EXECUTE PROCEDURE on_ins_payroll();
> >
> >    The name of the trigger  is  the  same  but  the  table  they
> >    triggered  for  differs  and they call different functions.
> 
> I think trigger names shoud be unique. Like in Informix, Oracle, DB/2.
> 
> Remember to drop a trigger, the syntax usually is:
> 	drop trigger on_insert;

    Not in PostgreSQL. Here it is

        DROP TRIGGER trigname ON relation;

> 
> so you could safely name the function _trig_<triggername> e.g.
> 
> Andreas
> 
> 
> 


Jan

-- 

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #


Fri, 14 Aug 1998 11:33:40 +0200 (MET DST)
jwieck@debis.com (Jan Wieck)
Re: [HACKERS] Rule system (trigger names)