Re: Dropping a schema - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Dropping a schema
Date
Msg-id 19950.1029938574@sss.pgh.pa.us
Whole thread Raw
In response to Dropping a schema  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: Dropping a schema  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-hackers
Oliver Elphick <olly@lfix.co.uk> writes:
>   olly=# drop schema testing;
>   NOTICE:  table testing.testa depends on schema testing
>   ERROR:  Cannot drop schema testing because other objects depend on it
>         Use DROP ... CASCADE to drop the dependent objects too

> This seems a little over-restrictive to me.

It's per spec: SQL92 saith
        3) If RESTRICT is specified, then S shall not contain any per-           sistent base tables, global temporary
tables,created local           temporary tables, views, domains, assertions, character sets,           collations, or
translations.
           Note: If CASCADE is specified, then such objects will be dropped           by the effective execution of the
SQLschema manipulation state-           ments specified in the General Rules of this Subclause.
 

Also, it seems the safest behavior to me.  "rmdir dir" won't remove a
nonempty directory; isn't that a pretty close analogy?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal: make "opaque" obsolete
Next
From: Tom Lane
Date:
Subject: Re: 7.3 TODO