CREATE TRIGGER update_eel_time BEFORE
INSERT
OR
UPDATE
ON
datawg.t_eelstock_eel FOR EACH ROW EXECUTE PROCEDURE datawg.update_eel_last_update();
CREATE OR REPLACE FUNCTION datawg.update_eel_last_update()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
BEGIN
NEW.eel_datelastupdate = now()::date;
RETURN NEW;
END;
$function$
;
CREATE TRIGGER update_eel_time BEFORE INSERT OR UPDATE ON datawg.t_eelstock_eel FOR EACH ROW EXECUTE PROCEDURE datawg.update_eel_last_update();
CREATE OR REPLACE FUNCTION datawg.update_eel_last_update() RETURNS trigger LANGUAGE plpgsql AS $function$ BEGIN NEW.eel_datelastupdate = now()::date; RETURN NEW; END; $function$ ;