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

Can't filter & sort column with enum type #17

Closed
Vija02 opened this issue May 6, 2022 · 5 comments
Closed

Can't filter & sort column with enum type #17

Vija02 opened this issue May 6, 2022 · 5 comments
Labels
bug Something isn't working PostgreSQL
Milestone

Comments

@Vija02
Copy link

Vija02 commented May 6, 2022

Example of enum:

create type status as enum ('PENDING', 'DONE');

Here's the error message on filter:

(generated query): Query execution problem (backend said 'ERROR: collations are not supported by type .... Position: 46')
@Vija02 Vija02 changed the title Can't filter column with enum type Can't filter & sort column with enum type May 6, 2022
@eirikbakke
Copy link
Contributor

Which database backend is this on?

A workaround is to insert a formula field (Insert Calculated Field Before) and enter =TEXT([NameOfYourEnumColumn]). Then you can filter on the calculated field instead.

@eirikbakke eirikbakke added the bug Something isn't working label May 6, 2022
@Vija02
Copy link
Author

Vija02 commented May 7, 2022

I'm using PostgreSQL

@eirikbakke
Copy link
Contributor

Thanks!

@eirikbakke
Copy link
Contributor

eirikbakke commented Sep 6, 2022

The fix for this issue on PostgreSQL connections will be in the next Ultorg release; thank you for reporting!

Tables with enums are now also part of the automated tests that run before each Ultorg release.

On MySQL, enums seemed to work already, but I added some extra code to the MySQL dialect handler to cast them to CHAR e.g. before using them in an ORDER BY clause (to ensure alphabetic rather than index order). Oracle, Microsoft SQL Server, SQLite, and Presto/Athena do not have a dedicated enum type, and so are not affected.

@eirikbakke eirikbakke added this to the 1.2.1 milestone Sep 6, 2022
@eirikbakke
Copy link
Contributor

Hi, Michael. There's a new Ultorg release up now, at the old download link, which fixes this bug.

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PostgreSQL
Projects
None yet
Development

No branches or pull requests

2 participants