TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PostgreSQL's Missing DateDiff Function

8 pointsby cedricdalmost 4 years ago

2 comments

ahmedelsamaalmost 4 years ago
I am a data person and I never knew about the boundary counting. Like you can have a `day diff` be 3 and the `week diff` be 1 and the `month diff` be 1 You can also have `day diff` be 25 and the `month diff` be 0.<p>I would love to know why warehouse do this because as a data person it confuses me and is even more confusing to explain to stakeholders.
评论 #27676483 未加载
cedricdalmost 4 years ago
Author here. I&#x27;ve used pg a ton in the past in production systems as an operational database. Never really missed having datediff.<p>Once we started using it as a data warehouse I noticed that function was missing -- most other data warehouses have it. Thought it would be worth providing an implementation since date stuff is annoying to do.
评论 #27676640 未加载