Skip to content

sql: cannot do schema operations on a database different from the session's database #54295

@jordanlewis

Description

@jordanlewis

Unlike other commands in the database, you can't make or reference a schema inside of a database that isn't the one that your session is attached to. Repro:

root@127.0.0.1:63131/defaultdb> create schema foo;
CREATE SCHEMA

Server Execution Time: 2.667ms
Network Latency: 28.512ms

root@127.0.0.1:63131/defaultdb> create schema otherdb.foo;
invalid syntax: statement ignored: at or near ".": syntax error
SQLSTATE: 42601
DETAIL: source SQL:
create schema otherdb.foo

I'd expect that the latter statement work okay. This is also a problem for every other command that references a schema, such as ALTER TABLE SET SCHEMA, ALTER SCHEMA, DROP SCHEMA, etc.

Metadata

Metadata

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions