Skip to content

ALTER TYPE DROP VALUE does not support "IF EXISTS" suffix #120801

@smklein

Description

@smklein

Is your feature request related to a problem? Please describe.

It's extremely useful for DDL statements to be idempotent - the IF NOT EXISTS syntax is a part of CockroachDB and Postgres as a whole that makes this feasible.

Describe the solution you'd like

Postgres' interface has this syntax already, but:

https://www.postgresql.org/docs/current/sql-altertype.html

ALTER TYPE name DROP ATTRIBUTE [ IF EXISTS ] attribute_name [ CASCADE | RESTRICT ]

By supporting this interface, it would be much easier to issue "idempotent DDL statements" to CockroachDB.

Jira issue: CRDB-36872

Epic CRDB-60817

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityP-3Issues/test failures with no fix SLAT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions