pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 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 18:26:11 -0400
Message-ID: <20160812222611.GA721702@alvherre.pgsql> (raw)
In-Reply-To: <24531.1471039297@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>

Tom Lane wrote:

> > also, object locks need to be acquired, which
> > can be very troublesome if you discover that some frequently-used object
> > is in the set to be dropped, by some unfortunate accident.
> 
> You'd need the object locks in any case, to be sure things hold still long
> enough for their dependencies to be examined.  It's possible a weaker lock
> type would suffice, but I'm not sure; we generally don't require exclusive
> lock on an object to add or remove dependencies on it.

Of course, using a weak lock could run afoul of somebody changing the
dependencies underneath.  But even using a stronger lock is unlikely to
give any actual protection: in UI programs (be it GUI admin programs or
psql), more likely than not many users are going to run a check in one
transaction, then run the actual drop in a different transaction.

> I'm not necessarily against adding a function to report the dependencies
> as a table rather than NOTICE output.  But things have been like this
> for quite a few years and I can count the number of requests for such a
> function without running out of thumbs.  Doesn't seem very high priority.

Sure.  Perhaps this'd be a good item for a novice hacker.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
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: <20160812222611.GA721702@alvherre.pgsql>
Permalink:  ../20160812222611.GA721702@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160812222611.GA721702@alvherre.pgsql

 · 

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: alvherre@2ndquadrant.com, 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: <20160812222611.GA721702@alvherre.pgsql>

* 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