Should something like this work? ```ts await supab...
# javascript
s
Should something like this work?
Copy code
ts
await supabase
  .from('posts')
  .update({ valid_until: `now() + interval '30 day'` })
  .eq('id', postId);
valid_until
is of type
timestamp with time zone
Edit: It would appear not... What's the best way to achieve this?
Copy code
json
{
  "hint": null,
  "message": "invalid input syntax for type timestamp with time zone: \"now() + interval '30 day'\"",
  "code": "22007",
  "details": null
}
s
I would suggest you either do this in JavaScript using
new Date
function or make the valid_until happen in a stored procedure or a function.
s
I opted for a psql function, thanks @User 🙂