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

Support for Array of Enums #6

Open
jamlen opened this issue Jun 20, 2022 · 1 comment
Open

Support for Array of Enums #6

jamlen opened this issue Jun 20, 2022 · 1 comment

Comments

@jamlen
Copy link

jamlen commented Jun 20, 2022

I want to define a column which is an array of enum values, but whilst I can create the table and execute an INSERT, I can’t select the record back and I get this error

BadRequestException: Array of type 'zones' is not supported

and it fails in the Console RDS window if I just try SELECT * FROM product.

Here is a sql fiddle of what I'm trying to support

See discussion on slack here

@omikader
Copy link
Contributor

One workaround is to cast the enum type to a text type before aggregating it into an array. For instance, if your enum type is called my_enum_type, you could do this:

SELECT some_column, array_agg(my_enum_column::text) AS enum_array
FROM your_table
GROUP BY some_column;

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

2 participants