sql: support postgresql date() function to convert timestamp to date #97067
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
The DATE() function in PostgreSQL allows you to extract a date value from a timestamp.
This syntax looks like the following:
Alternative solutions would be to just cast to a date, but this requires a code change for existing applications.
Another solution could be a UDF, but this is scoped by the schema/namespace.
I think the ideal solution would be to have this function native in Cockroach since it is native to PostgreSQL. One interesting thing I'll point out is that I could not find any documentation of this function in the Postgres docs.
Jira issue: CRDB-24488
The text was updated successfully, but these errors were encountered: