Bare sørg for, at alle tabeller har det samme kolonnenavn:
CREATE OR REPLACE FUNCTION upd_timestamp() RETURNS TRIGGER
LANGUAGE plpgsql
AS
$$
BEGIN
NEW.modified = CURRENT_TIMESTAMP;
RETURN NEW;
END;
$$;
CREATE TRIGGER t_name
BEFORE UPDATE
ON tablename
FOR EACH ROW
EXECUTE PROCEDURE upd_timestamp();