Ganesh,
Did you have a look at example Example 35-2. A PL/pgSQLhttp://www.postgresql.org/docs/current/static/plpgsql-trigger.html
RegdsmaLLAH