Skip to content

workload/schemachange: allow pgcode.NoPrimaryKey when primary key is dropped #57493

@jayshrivastava

Description

@jayshrivastava

When dropConstraint is called on the primary key of a table, subsequent DDLs in the transaction on the same table should expect a pgcode.NoPrimaryKey on execution.

This should apply to all DDLs except for the case when add constraint ... primary key follows the dropping of the primary key (see https://www.cockroachlabs.com/docs/v20.2/add-constraint#changing-primary-keys-with-add-constraint-primary-key)

Examples of failures (roachtest):
#56081 (comment)
#56081 (comment)
#56081 (comment)
#56081 (comment)
#56081 (comment)
#56081 (comment)

Jira issue: CRDB-3527

Epic CRDB-19168

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-random-schema-change-workloadC-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions