Skip to content

Instantly share code, notes, and snippets.

@chalkygames123
Created December 14, 2025 12:26
Show Gist options
  • Select an option

  • Save chalkygames123/a0bde74a9ad3f09dfc413fd23118e198 to your computer and use it in GitHub Desktop.

Select an option

Save chalkygames123/a0bde74a9ad3f09dfc413fd23118e198 to your computer and use it in GitHub Desktop.
create function set_updated_at () returns trigger language plpgsql
set
search_path = '' as $$begin
new.updated_at = now();
return new;
end;
$$;
create trigger before_update_test_reports_row_set_updated_at before
update on test_reports for each row
execute function set_updated_at ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment