Thank you Martin!!! you've just saved my life! ; ) Regards Ling. "Martin Marques" <martin@bugs.unl.edu.ar> wrote in message 200310192000.56808.martin@bugs.unl.edu.ar">news:200310192000.56808.martin@bugs.unl.edu.ar... El Dom 19 Oct 2003 13:54, Ling escribió: > Hello there. > Can anybody help me with Postgresql triggers? > what I need is a trigger which inrements value in field "total_rows.rows" > if I insert new row in table "zzz"... > > CAREATE TABLE zzz ( > ... > ... > ); > CREATE TABLE total_rows ( > table_name VARCHAR(32), > total_rows BIGINT, > CONSTRAINT pk_total_rows PRIMARY KEY(table_name, total_rows) > ); A rule would be much easier: CREATE RULE rule_name AS ON INSERT TO zzz DO <Write an update of total_rows query here>; -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; ----------------------------------------------------------------- Martín Marqués | mmarques@unl.edu.ar Programador, Administrador, DBA | Centro de Telemática Universidad Nacional del Litoral ----------------------------------------------------------------- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php