0

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?

4

1 回答 1

0

所以我还没有找到直接在 GUI 中定义它的方法(这是我想知道的)。如果有人知道如何,请在此处发布,我会接受该答案。同时,在 Postico 的查询界面中执行一个 SQL Query

在此处输入图像描述

定义类型,如下所示:

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

之后,GUI 界面允许您在列上设置类型。

于 2021-12-29T21:32:48.450 回答