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.
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) forCREATE TENANT(#119 / 86e8ea9) andSHOW TENANT(#126 / 56a29f1), butDROP TENANT,ALTER TENANT, andPURGE TENANTstill require a numeric ID and reject names withERROR: TENANT ID must be a numeric value.Repro
Same error from
ALTER TENANT <name> ...andPURGE TENANT <name>.Expected
Name resolution as in
CREATE TENANT(create.rs:91usesfind_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:60nodedb/src/control/server/pgwire/ddl/tenant/alter.rs:40nodedb/src/control/server/pgwire/ddl/tenant/purge.rs:35(plus
create.rs:38for the optionalID <id>clause, where numeric-only is correct)Suggested fix
Mirror the
CREATE TENANTname-resolution: try numeric parse first; on failure, fall back tostate.credentials.catalog().find_tenant_by_name(name)and resolve to thetenant_id.StoredTenant.namealready 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 mae8for clean-rebuild scenarios is currently impossible without first looking up the numeric ID viaSHOW TENANTS.