1CREATE OR REPLACE FUNCTION public.set_current_timestamp_updated_at()
2 RETURNS trigger
3 LANGUAGE plpgsql
4AS $function$
5DECLARE
6 _new record;
7BEGIN
8 _new := NEW;
9 _new."updated_at" = NOW();
10 RETURN _new;
11END;
12$function$
13
14
15CREATE TRIGGER set_updated_at
16BEFORE UPDATE ON your_table
17FOR EACH ROW
18EXECUTE FUNCTION set_current_timestamp_updated_at();
19