[
https://issues.apache.org/jira/browse/CALCITE-7337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
terran2010 updated CALCITE-7337:
--------------------------------
Summary: Add age function (enabled in Postgresql library) (was: There is
no age function that supports pgSQL)
> Add age function (enabled in Postgresql library)
> ------------------------------------------------
>
> Key: CALCITE-7337
> URL: https://issues.apache.org/jira/browse/CALCITE-7337
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Affects Versions: 1.41.0
> Reporter: terran2010
> Priority: Major
> Labels: pull-request-available
>
> The SQL:
> {code:java}
> SELECT AGE(timestamp '2023-12-25', timestamp '2020-01-01') as age1 FROM
> (VALUES (1)) t {code}
> result is ok:
> {code:java}
> 3 years 11 mons 24 days 0 hours 0 mins 0.0 secs {code}
> But is:
> {code:java}
> Error while executing SQL "SELECT AGE(timestamp '2023-12-25', timestamp
> '2020-01-01') as age1 FROM (VALUES (1)) t": From line 1, column 8 to line 1,
> column 58: No match found for function signature AGE(<TIMESTAMP>,
> <TIMESTAMP>) {code}
> we can refer postgresql document about Position:
> [https://www.postgresql.org/docs/current/functions-datetime.html]
> In pgSQL, execute the following
> {code:java}
> SELECT AGE(timestamp '2023-12-25', timestamp '2020-01-01') as age1 FROM
> (VALUES (1)) t; {code}
> result:
> {code:java}
> 3 years 11 mons 24 days 0 hours 0 mins 0.0 secs {code}
> We can consider adding this function to help us use it more conveniently in
> computing time scenarios
--
This message was sent by Atlassian Jira
(v8.20.10#820010)