6

A Public schema is created when we create a database and tables are created under Public schema if we don't specify any schema.

Will I face any issues if I drop the Public schema from the database as I don't want anyone to create tables under it?

2 Answers 2

5

Technically nothing stands in the way of removing it.

I am deliberately dropping the Public schema from new databases, because I want users to come up with more meaningful names. This way we avoid having this general purpose schema. It requires more care and thoughtfulness from developers, which I find productive.

If you take a Snowflake University course, you will notice that they are doing exactly the same thing - when a task requires creating new database, the very next step is dropping the PUBLIC schema and creating one or more schemas witch some valuable names.

edit: it is now possible to drop the PUBLIC schema after db creation with the official terraform provider by Snowflake-Labs (https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/database#drop_public_schema_on_creation).

Sign up to request clarification or add additional context in comments.

Comments

0

Dropping public schema is not a good choice. That's the behaviors of snowflake to create table in the public schema to when user haven't specified the schema. So do a role based access control if you don't wanted to use public schema.

2 Comments

Thanks Arun. Can you please elaborate on why deletion is not a good choice?
FWIW I disagree with the statement "Dropping public schema is not a good choice". I would not want to allow tables to be created without specifying a schema.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.