Open xiangjinwu opened 1 year ago
Is it possible to add to the list date_diff? Current alternative is taking the epoch and then subtracting by given unit you want:
(EXTRACT(EPOCH FROM date2 - date1) / 86400)::int
This issue has been open for 60 days with no activity.
If you think it is still relevant today, and needs to be done in the near future, you can comment to update the status, or just manually remove the no-issue-activity
label.
You can also confidently close this issue as not planned to keep our backlog clean. Don't worry if you think the issue is still valuable to continue in the future. It's searchable and can be reopened when it's time. 😄
https://www.postgresql.org/docs/current/functions-datetime.html
Caveats:
1 BC
proto ExprType 101..=108
Cast
Arithmetic operators
Basic
age(timestamp, timestamp)
-> intervalage(timestamptz, timestamptz)
-> intervaldate_bin(interval, timestamp, timestamp)
-> timestampdate_bin(interval, timestamptz, timestamptz)
-> timestamptzdate_trunc(field, interval)
-> intervaldate_trunc(field, timestamp)
-> timestampdate_trunc(field, timestamptz, zone)
-> timestamptzdate_part
/extract
#8817AT TIME ZONE
to_timestamp(double)
-> timestamptzjustify_days
/justify_hours
/justify_interval
make_date
/make_timestamp
/make_timestamptz
/make_time
https://github.com/risingwavelabs/risingwave/pull/14827make_interval
OVERLAP
isfinite
#9091(not in PostgreSQL)Formatting
to_char
/to_date
/to_timestamp
in #8831Current
current_timestamp
/transaction_timestamp()
/now()
-> timestamptzlocaltimestamp
-> timestampcurrent_date
-> date /age(timestamp)
-> interval /age(timestamptz)
-> intervallocaltime
-> timeNonstandard:
statement_timestamp()
-> timestamptzclock_timestamp()
-> timestamptz /timeofday()
-> varchar'now'
/'today'
/'tomorrow'
/'yesterday'
No support
pg_sleep
https://github.com/risingwavelabs/risingwave/issues/2561#issuecomment-1127386742current_time
-> timetzcurrent_time(int)
-> timetzAggregate
sum
/avg
for intervalSet Returning Functions
generate_series(start T, stop T, step INTERVAL)
->setof T
whereT
is timestamp / timestamptz