© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
3 replies
Revadike

Handing `created_at` and `updated_at`

I thought this would be trivial, but it turned out to be quite a headache. Can someone please teach or show me to do the following:

- Add RLS policy to prevent authenticated users from inserting rows with
updated_at
updated_at
and
created_at
created_at
values (it should just use the defaults:
NULL
NULL
and
now()
now()
respectively)
- Add RLS policy to prevent authenticated users from updating rows with (new)
updated_at
updated_at
and
created_at
created_at
values
- Add a trigger that automatically updates
updated_at
updated_at
to
now()
now()
when a row gets updated
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Why does my created_at column get updated?
SupabaseSSupabase / help-and-questions
3y ago
updated_at
SupabaseSSupabase / help-and-questions
4y ago
Automatically update updated_at timestampz
SupabaseSSupabase / help-and-questions
3y ago
How to update the updated_at field automatically
SupabaseSSupabase / help-and-questions
5mo ago