awan1
July 24, 2024, 9:14pm
1
is there an easy way to drop a schema or user in CrateDB? I was not able to find anything in the documentation about it.
You can drop a user, but not a schema currently. Schemas are implicitly created.
Tables are the basic building blocks of a relational database. A table can hold multiple rows (i.e., records), with each row having multiple columns and each column holding a single data element (i.e., value). You can query tables to insert data,...
awan1
July 24, 2024, 9:26pm
3
I can see my schema from the output of the “show schema;” command however I am unable to drop it. I see no drop schema command in the docs. The schema is listed but not shown in the following output. I am not seeing the username listed from the following output. SELECT * FROM sys.users;
awan1
July 24, 2024, 9:27pm
4
thanks for the quick reply!
matriv
July 25, 2024, 1:56pm
5
FYI there are open issues regarding the support of explicit schemas:
opened 12:07PM - 16 Aug 23 UTC
feature: pgsql
feature: sql: schema mgmt
complexity: no estimate
tool: dbt
### Problem Statement
For improved compatibility, it could be useful to not f… ail on `CREATE SCHEMA` requests.
### Possible Solutions
Implement as a no-op
### Considered Alternatives
When the tools allow it, configure them to not use `CREATE SCHEMA` (using for instance macro overrides in dbt)
opened 12:15PM - 16 Aug 23 UTC
feature: pgsql
feature: sql: schema mgmt
complexity: no estimate
tool: dbt
### Problem Statement
For improved compatibility, it could be useful to impleme… nt `DROP SCHEMA`
### Possible Solutions
Without `CASCADE`, check if anything exists on the schema and if so return
```
cannot drop schema _____ because other objects depend on it
```
With `CASCADE`, drop any tables and views on the schema.
### Considered Alternatives
When the tools allow it, configure them to not use `DROP SCHEMA` (using for instance macro overrides in `dbt`)
which you can upvote.
And they depend on a large refactoring of the internal representation of those metadata: First class table & partitions within cluster state · Issue #11939 · crate/crate · GitHub which we currently work on.
awan1
July 25, 2024, 2:42pm
6
Thank you for sharing this information!