Skip to content

upgrade of DROP CONSTRAINT #3761

@TarantoolBot

Description

@TarantoolBot
Collaborator

Related dev. issue(s): tarantool/tarantool#9112

Product: Tarantool
Since: 3.0
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_sql/sql_statements_and_clauses/#alter-table
SME: @ ImeevMA

Details

Now, instead of just ALTER TABLE table DROP CONSTRAINT constraint; we
have 8 operator variants:

  1. Statement to drop PRIMARY KEY, UNIQUE, tuple FOREIGN NEY or tuple
    CHECK constraints:
ALTER TABLE tab_name DROP CONSTRAINT constr_name;

This statement cannot drop a constraint if constr_name matches
more than one constraint.

  1. Statement to drop field FOREIGN NEY or field CHECK constraints:
ALTER TABLE tab_name DROP CONSTRAINT field_name.constr_name;

This statement cannot drop a constraint if constr_name matches
more than one constraint for the field_name field.

  1. Statement to drop PRIMARY KEY constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name PRIMARY KEY;
  1. Statement to drop UNIQUE constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name UNIQUE;
  1. Statement to drop tuple FOREIGN KEY constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name FOREIGN KEY;
  1. Statement to drop tuple CHECK constraint:
ALTER TABLE tab_name DROP CONSTRAINT constr_name CHECK;
  1. Statement to drop field FOREIGN KEY constraint:
ALTER TABLE tab_name DROP CONSTRAINT field_name.constr_name FOREIGN KEY;
  1. Statement to drop field CHECK constraint:
ALTER TABLE tab_name DROP CONSTRAINT field_name.constr_name CHECK;

Requested by @ ImeevMA in tarantool/tarantool@263777d.

Activity

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

    3.0sql[location] SQL manual

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @TarantoolBot@andreyaksenov@veod32

        Issue actions

          upgrade of DROP CONSTRAINT · Issue #3761 · tarantool/doc