[
https://issues.apache.org/jira/browse/CALCITE-6311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17847062#comment-17847062
]
Norman Jordan commented on CALCITE-6311:
----------------------------------------
Another twist with PostgreSQL. The first argument is a string and could come
from anywhere. For example this query is allowed:
{code:java}
SELECT DATE_PART(x, TO_DATE('2024-05-15', 'YYYY-MM-DD')) FROM foo {code}
As long as x has a value that is a valid time unit, the query will succeed.
> Support PostgreSQL DATE_PART
> ----------------------------
>
> Key: CALCITE-6311
> URL: https://issues.apache.org/jira/browse/CALCITE-6311
> Project: Calcite
> Issue Type: Sub-task
> Reporter: James Duong
> Assignee: Norman Jordan
> Priority: Minor
>
> * PostgreSQL and Redshift let the date_part parameter be a string instead of
> a just an enum-like identifier (eg DATE_PART('year', ...) and DATE_PART(year,
> ...) are both supported.
> * SQL Server does not support using a string here.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)