简体   繁体   中英

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.

在此处输入图像描述

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?

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

在此处输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM