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

Issue found on page 'Enum Data Type': Would be good to mention you use anonymous ENUM types in CAST operations (without CREATE TYPE) #4440

Open
rpbouman opened this issue Dec 24, 2024 · 0 comments

Comments

@rpbouman
Copy link
Contributor

The ENUM data type page currently suggests you need to create the ENUM type explicitly using CREATE TYPE.

However, it is possible to use anonymous ENUMs in CAST expressions, in which case no CREATE TYPE statement is required beforehand:

SELECT 'ok'::ENUM ('sad', 'ok', 'happy') as mood

It would be good to mention this syntax.

Page URL: https://duckdb.org/docs/sql/data_types/enum.html

@rpbouman rpbouman changed the title Issue found on page 'Enum Data Type': Would be good to mention you can CAST to implicit ENUM which does not require CREATE TYPE Issue found on page 'Enum Data Type': Would be good to mention you use anonymous ENUM types in CAST operations (without CREATE TYPE) Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant