Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PostgreSQL :: style casts #25259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dain
Copy link
Member

@dain dain commented Mar 9, 2025

Description

This PR proposes adding PostgreSQL style double colon :: casts to Trino. I find the standard SQL cast CAST(something as BIGINT) is quite wordy and difficult to write compared to :: especially when it is necessary to drop casts into existing queries (due the the strict nature of SQL type system). I find being able to drop a simple ::type on a symbol reference or function call to be super easy in PostgreSQL.

Release notes

(X) Release notes are required, with the following suggested text:

## Section
* Add support for PostgreSQL style `::` casts. ({issue}`issuenumber`)

@dain dain requested a review from martint March 9, 2025 02:52
@cla-bot cla-bot bot added the cla-signed label Mar 9, 2025
@martint
Copy link
Member

martint commented Mar 9, 2025

See #23795 (comment)

@dain
Copy link
Member Author

dain commented Mar 9, 2025

See #23795 (comment)

@martint that sounds great. It means that we have no concern that something useful will be used for this. I don't see us ever implementing that part of the spec, so we can use this operator for something awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants