Skip to content

DROP/ALTER/PURGE TENANT <name> rejected — name resolution missing on these paths #130

Description

@emanzx

Tested against: origin/main @ 25040fdf (post-v0.3.0 main head, 2026-06-08)

Severity: Medium — DDL inconsistency across tenant operations.

Summary

v0.3.0 added name resolution (TenantSelector) for CREATE TENANT (#119 / 86e8ea9) and SHOW TENANT (#126 / 56a29f1), but DROP TENANT, ALTER TENANT, and PURGE TENANT still require a numeric ID and reject names with ERROR: TENANT ID must be a numeric value.

Repro

-- works post-v0.3.0:
CREATE TENANT IF NOT EXISTS test_tenant;
SHOW TENANT test_tenant;

-- fails:
DROP TENANT IF EXISTS test_tenant;
-- ERROR: TENANT ID must be a numeric value

DROP TENANT test_tenant;
-- ERROR: TENANT ID must be a numeric value

Same error from ALTER TENANT <name> ... and PURGE TENANT <name>.

Expected

Name resolution as in CREATE TENANT (create.rs:91 uses find_tenant_by_name()). All TENANT DDL paths should accept either <id> or <name>.

Files

The hard-coded numeric parse with that exact error message lives in:

  • nodedb/src/control/server/pgwire/ddl/tenant/drop.rs:60
  • nodedb/src/control/server/pgwire/ddl/tenant/alter.rs:40
  • nodedb/src/control/server/pgwire/ddl/tenant/purge.rs:35

(plus create.rs:38 for the optional ID <id> clause, where numeric-only is correct)

Suggested fix

Mirror the CREATE TENANT name-resolution: try numeric parse first; on failure, fall back to state.credentials.catalog().find_tenant_by_name(name) and resolve to the tenant_id. StoredTenant.name already exists for this purpose.

A PR is forthcoming — small, well-scoped, mirrors the existing CREATE pattern for drop/alter/purge.

Operational context

Affects mae8 v2 substrate management — DROP TENANT mae8 for clean-rebuild scenarios is currently impossible without first looking up the numeric ID via SHOW TENANTS.

Activity

  1. added a commit that references this issue on Jun 18, 2026
    0ae2385
  2. added a commit that references this issue on Jul 4, 2026
    d0c933f
  3. added
    type:bugA defect — broken, incorrect, or lost data
    sev:3-mediumFeature wrong, but operational and a workaround exists
    area:sqlParser, planner, SQL semantics
    on Jul 8, 2026
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

    area:sqlParser, planner, SQL semanticssev:3-mediumFeature wrong, but operational and a workaround existstype:bugA defect — broken, incorrect, or lost data

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions