Skip to content

sql: allow CREATE/DROP SCHEMA and CREATE/DROP ROLE in stored procedures#170141

Draft
spilchen wants to merge 1 commit into
cockroachdb:masterfrom
spilchen:spilchen/gh-170018/260511/0120p/incl-schema-and-roles-in-proc
Draft

sql: allow CREATE/DROP SCHEMA and CREATE/DROP ROLE in stored procedures#170141
spilchen wants to merge 1 commit into
cockroachdb:masterfrom
spilchen:spilchen/gh-170018/260511/0120p/incl-schema-and-roles-in-proc

Conversation

@spilchen
Copy link
Copy Markdown
Contributor

Summary

  • Extend the optbuilder allowlist opened by sql: add DDL support for CREATE/DROP TABLE in stored procedures #168464 (CREATE/DROP TABLE) to also cover CREATE/DROP SCHEMA and CREATE/DROP ROLE inside PL/pgSQL stored procedure bodies.
  • Functions and DO blocks remain blocked. The same v26.3 cluster version gate applies, so the feature only activates after the upgrade is finalized.

Test plan

  • ./dev testlogic --files=procedure_ddl passes across all configs.

Closes #170018
Epic: CRDB-31256

🤖 Generated with Claude Code

Extend the optbuilder allowlist that was opened for CREATE/DROP TABLE
in PR cockroachdb#168464 to also cover CREATE/DROP SCHEMA and CREATE/DROP ROLE
inside PL/pgSQL stored procedure bodies. Functions and DO blocks
remain blocked. The same v26.3 cluster version gate applies, so the
feature only activates after the upgrade is finalized.

Closes cockroachdb#170018
Epic: CRDB-31256
Release note (sql change): CREATE SCHEMA, DROP SCHEMA, CREATE ROLE,
and DROP ROLE can now be used in PL/pgSQL stored procedure bodies.
@spilchen spilchen self-assigned this May 11, 2026
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented May 11, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

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.

sql: allowlist expansion for CREATE/DROP SCHEMA and CREATE/DROP ROLE in procedures

2 participants