Skip site navigation (1) Skip section navigation (2)

The efficient method to create trigger

From: Jignesh Shah <jignesh(dot)shah1980(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: The efficient method to create trigger
Date: 2009-08-18 10:18:36
Message-ID: c11950270908180318q52dc388cg72b2c3ca2e9fe2d@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

I am new to PostgreSQL. I learnt most of things from postgresql.org site. I
want to write a trigger for on my table tech_projects such that whenever
INSERT, UPDATE or DELETE happen on this table, the trigger should get called
and the updated/deleted row must be added to tech_projects_backup table.
Moreover, if there are more than one row updated then I don't want to
reiterate the client-server communication for each row but instead it should
process all rows at once.

Could anyone please tell me which is the best way (PL/pgSQL, PL/Tcl, PL/Perl
or PL/Python). I know the Perl but not aware of Tcl and Python. It would be
great if some one could give example on processing multiple rows at once. I
am not sure how could I use spi_prepare for this.

Thanks, Jignesh

Responses

pgsql-novice by date

Next:From: A. KretschmerDate: 2009-08-18 10:39:48
Subject: Re: The efficient method to create trigger
Previous:From: Tom LaneDate: 2009-08-15 01:09:26
Subject: Re: ORDER BY problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group