Thanks Sean. I just want to know which one is better approach to write trigger in PostgreSQL. PL/pgSQL or PL/Perl or PL/Tcl or PL/Python? I know Perl but not aware of Tcl and Python. Any method could replace any other method?
If you know perl, then use perl. Flexibility is just one of the joys of using Postgresql. The PL/Perl chapter of the manual has a section devoted to triggers.