pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Vik Fearing <vik@2ndquadrant.fr>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: denisa.cirstescu@asentinel.com, "pgsql-docs@postgresql.org" <pgsql-docs@postgresql.org>
Subject: Re: Undocumented behavior od DROP SCHEMA ... CASCADE
Date: Fri, 12 Aug 2016 10:01:44 -0400
Message-ID: <25576.1471010504@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZNS9YHs4xxgY3TEfHYP9fZjgsmuDn0+dLvD29k76=-sA@mail.gmail.com>
References: <20160805104837.1412.84915@wrigleys.postgresql.org>
	<fbb1360b-e450-aaf6-19bd-9bfcffb35ed7@2ndquadrant.com>
	<7aeb5291-b9ca-3a3c-0bd8-e60b56ec2693@2ndquadrant.fr>
	<CAKFQuwZNS9YHs4xxgY3TEfHYP9fZjgsmuDn0+dLvD29k76=-sA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Fri, Aug 12, 2016 at 8:54 AM, Vik Fearing <vik@2ndquadrant.fr> wrote:
>> I think the OP is complaining that cascading to b.v is not sufficiently
>> documented.  It seems logical to me that this would be the correct
>> behavior, but since at least one person got confused enough about it to
>> come and tell us, we should probably add some kind of warning or something.

> ​Yeah, it should probably be modified to something like:

> Automatically drop objects (tables, functions, etc...) that are contained
> in the schema.  Each object dropped is also done with the CASCADE option.
> This means that others schemas will be affected if they depend on objects
> in the named schema.

If we're going to add a warning about CASCADE being recursive, it would
logically need to be added to every last DROP command that has a CASCADE
option, which is most of them.  I don't necessarily object to that, but
we'd need a more boiler-plate, copy-and-pasteable phrasing.

A quick survey says that DROP SCHEMA is just about the only such command
that isn't documented with wording along the lines of "Automatically drop
objects that depend on the <whatever>", often with a parenthetical "such
as" to illustrate what sorts of objects might be dependent.  I think the
variant wording for DROP SCHEMA was intentional, with the thought that it
was easy to specify exactly which objects "depend on" a schema --- but is
that decision contributing to the confusion?

I'm inclined to suggest that maybe the generic phrasing could be
"Automatically drop objects that depend on the <whatever> [(such as ...)],
and in turn all objects that depend on those objects".

			regards, tom lane


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



view thread (15+ messages)  latest in thread

Message-ID: <25576.1471010504@sss.pgh.pa.us>
Permalink:  ../25576.1471010504@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25576.1471010504@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, vik@2ndquadrant.fr, peter.eisentraut@2ndquadrant.com
  Subject: Re: Undocumented behavior od DROP SCHEMA ... CASCADE
  In-Reply-To: <25576.1471010504@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox