Is is possible to convert an enum declared in a postgresql schema to text so that I could use like clause for the enum column?
Asked
Active
Viewed 1.5k times
1 Answers
31
You can cast the enum into text
easily and use any textual operators on it.
SELECT * FROM table WHERE enumfield::TEXT LIKE 'Some%';
There might be a better way to handle what you want to achieve since the performance of this isn't the best.

Andrii Abramov
- 10,019
- 9
- 74
- 96

Sami Kuhmonen
- 30,146
- 9
- 61
- 74