Skip to content

Create and edit PostgreSQL enums, domains and composite types #3606

Closed

Description

@datlechin

Problem

The Types section lists a schema's enums, composites, domains and ranges and shows each one's CREATE statement, but the tab is read-only (features/user-defined-types.mdx:33-35). Adding an enum label, changing a domain's constraint or adding a field to a composite type means opening the definition in the editor, writing the ALTER TYPE or ALTER DOMAIN by hand, running it, and refreshing the section. #2484 shipped the section and the column type picker; editing an enum's labels, which it also asked for, did not ship.

Proposed solution

  • Enum: add a label at a chosen position (ALTER TYPE ... ADD VALUE ... BEFORE or AFTER) and rename one (RENAME VALUE, PostgreSQL 10 and later). Removing or moving a label stays impossible, so the editor says why rather than offering it.
  • Domain: set or drop the default, set or drop NOT NULL, add, drop and validate a CHECK constraint (ALTER DOMAIN).
  • Composite: add, drop and rename a field, and change a field's type (ALTER TYPE ... ADD, DROP, RENAME and ALTER ATTRIBUTE).
  • New Type… on the Types section for an enum, domain or composite, and Rename, Drop (with Cascade) and Comment on any type.
  • Changes queue in the type's tab with Preview SQL and Save Changes, the same way the Structure tab works (features/table-structure.mdx:213-222), and go through Safe Mode.
  • An error from the server, such as a domain constraint that existing rows violate, is shown on the change that caused it.

Done when: each change above round-trips on PostgreSQL 13 to 18, and the Types section and the column type picker show the result without a manual refresh.

Alternatives considered

Open in Editor, write the ALTER TYPE or ALTER DOMAIN by hand, run it, then Refresh the Types section.

Platform

macOS

Related database type

PostgreSQL

Activity

  1. added
    enhancement
    platform-macos
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions