I created generic (for tables in different schemas) trigger function :

CREATE OR REPLACE FUNCTION setlastchange() RETURNS "trigger"
AS $$BEGIN
UPDATE serverti SET lastchange='now'  WHERE tablename=TG_RELNAME and
   schemaname=TG_SCHEMA;
RETURN NULL;
END$$  LANGUAGE plpgsql STRICT;


Unfortunately, this does not work since TG_SCHEMA is not valid in PL/pgSQL

How to determine schema name where table TG_RELNAME belongs in trigger 
function ?

Andrus.

table structure is:

CREATE TABLE serverti (
  schemaname CHARACTER(7),
  tablename CHARACTER(8) ,
  lastchange timestamp,
  primary key (schemaname, tablename) );



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to