It is Postgres specific, but I’ve gotten a lot of mileage out of the advice in this article:
https://supabase.com/blog/postgres-audit