The answer to this question suggests I can use the CASCADE
option of DROP SCHEMA
to remove all a schema and all its tables, but warns:
CASCADE
– Automatically drop objects (tables, functions, etc.) that are contained in the schema, and in turn all objects that depend on those objects
Being a novice to databases, I'm unsure about what objects may depend on objects within a schema. Is it possible that a table or some other object outside the schema that is dependent on an object inside the schema will be dropped as well? If I just want to eliminate a schema and all its contents without changing anything else, is using CASCADE
a good idea?
Best Answer
run it in a transaction, you'll get warnings for every cascading drop, ROLLBACK if don't like what you see.