pg_enum

A system catalogue table storing information about ENUM types

pg_enum is a system catalogue table storing information about ENUM types.

pg_enum was added in PostgreSQL 8.3 (commit 57690c68).

Definition by PostgreSQL version

pg_enum (PostgreSQL 13)

              Table "pg_catalog.pg_enum"
    Column     | Type | Collation | Nullable | Default
---------------+------+-----------+----------+---------
 oid           | oid  |           | not null |
 enumtypid     | oid  |           | not null |
 enumsortorder | real |           | not null |
 enumlabel     | name |           | not null |
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 12)

              Table "pg_catalog.pg_enum"
    Column     | Type | Collation | Nullable | Default
---------------+------+-----------+----------+---------
 oid           | oid  |           | not null |
 enumtypid     | oid  |           | not null |
 enumsortorder | real |           | not null |
 enumlabel     | name |           | not null |
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 11)

              Table "pg_catalog.pg_enum"
    Column     | Type | Collation | Nullable | Default
---------------+------+-----------+----------+---------
 enumtypid     | oid  |           | not null |
 enumsortorder | real |           | not null |
 enumlabel     | name |           | not null |
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 10)

              Table "pg_catalog.pg_enum"
    Column     | Type | Collation | Nullable | Default
---------------+------+-----------+----------+---------
 enumtypid     | oid  |           | not null |
 enumsortorder | real |           | not null |
 enumlabel     | name |           | not null |
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.6)

    Table "pg_catalog.pg_enum"
    Column     | Type | Modifiers
---------------+------+-----------
 enumtypid     | oid  | not null
 enumsortorder | real | not null
 enumlabel     | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.5)

    Table "pg_catalog.pg_enum"
    Column     | Type | Modifiers
---------------+------+-----------
 enumtypid     | oid  | not null
 enumsortorder | real | not null
 enumlabel     | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.4)

    Table "pg_catalog.pg_enum"
    Column     | Type | Modifiers
---------------+------+-----------
 enumtypid     | oid  | not null
 enumsortorder | real | not null
 enumlabel     | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.3)

    Table "pg_catalog.pg_enum"
    Column     | Type | Modifiers
---------------+------+-----------
 enumtypid     | oid  | not null
 enumsortorder | real | not null
 enumlabel     | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.2)

    Table "pg_catalog.pg_enum"
    Column     | Type | Modifiers
---------------+------+-----------
 enumtypid     | oid  | not null
 enumsortorder | real | not null
 enumlabel     | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.1)

    Table "pg_catalog.pg_enum"
    Column     | Type | Modifiers
---------------+------+-----------
 enumtypid     | oid  | not null
 enumsortorder | real | not null
 enumlabel     | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    "pg_enum_typid_sortorder_index" UNIQUE, btree (enumtypid, enumsortorder)
    

Documentation: pg_enum

pg_enum (PostgreSQL 9.0)

  Table "pg_catalog.pg_enum"
  Column   | Type | Modifiers
-----------+------+-----------
 enumtypid | oid  | not null
 enumlabel | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    

Documentation: pg_enum

pg_enum (PostgreSQL 8.4)

  Table "pg_catalog.pg_enum"
  Column   | Type | Modifiers
-----------+------+-----------
 enumtypid | oid  | not null
 enumlabel | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    

Documentation: pg_enum

pg_enum (PostgreSQL 8.3)

  Table "pg_catalog.pg_enum"
  Column   | Type | Modifiers
-----------+------+-----------
 enumtypid | oid  | not null
 enumlabel | name | not null
Indexes:
    "pg_enum_oid_index" UNIQUE, btree (oid)
    "pg_enum_typid_label_index" UNIQUE, btree (enumtypid, enumlabel)
    

Documentation: pg_enum

Change history

Examples

postgres=# CREATE TYPE foobar AS ENUM ('foo', 'bar', 'baz');
CREATE TYPE

postgres=# SELECT * FROM pg_enum ;
  oid  | enumtypid | enumsortorder | enumlabel 
-------+-----------+---------------+-----------
 16458 |     16456 |             1 | foo
 16460 |     16456 |             2 | bar
 16462 |     16456 |             3 | baz
(3 rows)
  • PostgreSQL documentation: pg_enum

Categories

Data type, System catalogue

See also

ENUM