Skip to content

Conversation

@taroface
Copy link
Contributor

@taroface taroface commented Dec 8, 2025

DOC-14789

Update the ALTER TABLE example to drop & add constraint atomically. For the following reasons, this example did not work (and may have never worked):

  • The commands alter a PK with the wrong name (primary, not tablename_pkey as per convention).
  • The PK on the table used in the example (users) is referenced by several FKs in the MovR dataset, so the txn actually rolls back.
  • In 24.1, autocommit_before_ddl was introduced, which causes the txn to commit before issuing the DDL, which causes the statements to fail.
  • In 25.3, create_table_with_schema_locked was enabled by default, and the MovR tables were adjusted accordingly. This means the tables disallow schema changes unless the schema_locked storage param is disabled on the table.

The examples are updated (appropriately for each version) to use a different MovR table (promo_codes), use the correct PK name, disable autocommit_before_ddl, and disable/re-enable schema_locked to allow the example to work.

@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 9fcb5fc
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/69373f2e990daf000841db53

@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 9fcb5fc
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/69373f2e13835b0008003235

@netlify
Copy link

netlify bot commented Dec 8, 2025

Netlify Preview

Name Link
🔨 Latest commit 9fcb5fc
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/69373f2e88fe2f0008b305aa
😎 Deploy Preview https://deploy-preview-21542--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@taroface taroface requested a review from a team as a code owner December 8, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant