Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postico GUI: How to setup an enum data type

I'm using Postico's GUI interface to define a table, but I need an enum data type for a column. I'm not finding anything in the documentation or online that clearly denotes how I setup the enum data type for use. What I do find are various changelist statements about improved support for enums, but no details on how to actually set up that type.

enter image description here

I've tried putting in the Type column both of the following, hoping it would "trigger" or define it automatically...

  • enum
  • enum ('Choice1', 'Choice2')

... but both were rejected as invalid. I know that theoretically, I should be able to name and define the enum somewhere else and then use the name I defined in my data type here. But where/how do I define that in Postico?

like image 342
ScottS Avatar asked Dec 17 '25 21:12

ScottS


1 Answers

So I have not found a way to directly define it in the GUI (which is what I was wanting to know). If someone knows how, post here and I'll accept that answer. In the mean time, execute a SQL Query in Postico's query interface

enter image description here

to define the type, like so:

CREATE TYPE your_type_name AS ENUM ('Choice1', 'Choice2');

After that, then the GUI interface allows you to set the type on a column.

like image 186
ScottS Avatar answered Dec 19 '25 13:12

ScottS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!