[
https://issues.apache.org/jira/browse/CALCITE-6756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17914278#comment-17914278
]
ZheHu commented on CALCITE-6756:
--------------------------------
Based on your description and PR, I'm a little confused:
what's the result of
{code:java}cast('10' as varchar) = 1{code}
after PG's dialect before your change.
> Preserving CAST of STRING operand in binary comparison for PostgreSQL
> ---------------------------------------------------------------------
>
> Key: CALCITE-6756
> URL: https://issues.apache.org/jira/browse/CALCITE-6756
> Project: Calcite
> Issue Type: Bug
> Reporter: xiong duan
> Priority: Major
> Labels: pull-request-available
>
> In Postgresql:
> {code:java}
> SELECT * FROM table where cast('10' as text) = 1; // throw operator does not
> exist: text = integer
> SELECT * FROM table where cast('10' as varchar) = 1; // operator does not
> exist: character varying = integer
> SELECT * FROM table where cast('10' as char) = 1; //operator does not exist:
> character = integer{code}
> So when generating Postgres SQL, we need to preserve the CAST of STRING.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)