Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 5
Newest
 Editor
Impact
~4k people reached

  • 0 posts edited
  • 0 helpful flags
  • 1 vote cast
Jul
3
comment How to get the difference in days between 2 timestamps in PostgreSQL
Thanks a lot @erwin-brandstetter for the complete answer and extra info. Learnt a bit about STABLE functions and sargables. The solution is clear, however I still have a doubt. In your second solution [...] status_updated_at < CURRENT_DATE - 10 I don't understand how the comparisson and coercion works. status_updated_at is a timestamp. CURRENT_DATE is a date. First of all, when you are substracting 10 from CURRENT_DATE why that 10 represents days and not other time unit. Finally, in the < comparisson, I am comparing a timestamp vs a date, date is coerced to a timestamp?
Jul
3
accepted How to get the difference in days between 2 timestamps in PostgreSQL
Jul
2
awarded  Editor
Jul
2
awarded  Supporter
Jul
2
revised How to get the difference in days between 2 timestamps in PostgreSQL
added 4 characters in body
Jul
2
comment How to get the difference in days between 2 timestamps in PostgreSQL
Exactly, I meant not, will edit the question.
Jul
2
asked How to get the difference in days between 2 timestamps in PostgreSQL
Feb
6
awarded  Notable Question
Apr
23
awarded  Popular Question
Jun
18
awarded  Student
Oct
23
awarded  Scholar
Oct
23
accepted Transform all columns records to lowercase
Oct
22
asked Transform all columns records to lowercase