Re: Dropping a schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Dropping a schema
Date: 2002-08-21 14:02:54
Message-ID: 19950.1029938574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oliver Elphick <olly(at)lfix(dot)co(dot)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 SQL schema 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-21 14:10:57 Re: 7.3 TODO
Previous Message Tom Lane 2002-08-21 13:47:36 Re: Proposal: make "opaque" obsolete