pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Hitoshi Harada <umi.tanuki@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6172: DROP EXTENSION error without CASCADE
Date: Sun, 21 Aug 2011 21:30:03 +0200
Message-ID: <m2wre6v9z8.fsf@2ndQuadrant.fr> (raw)
In-Reply-To: <201108211644.p7LGibJ1064013@wwwmaster.postgresql.org>
References: <201108211644.p7LGibJ1064013@wwwmaster.postgresql.org>

"Hitoshi Harada" <umi.tanuki@gmail.com> writes:
> On pure-installed RC1 database, you can CREATE EXTENSION, but cannot DROP
> it.
>
> CREATE EXTENSION cube;
> DROP EXTENSION cube;
>
> ERROR:  cannot drop extension cube because other objects depend on it

I confirm I have the same bug in current HEAD.


Reading the code, my gut feeling is that the bug sits in
findDependentObjects(), in this part of it:

				/*
				 * Okay, recurse to the other object instead of proceeding. We
				 * treat this exactly as if the original reference had linked
				 * to that object instead of this one; hence, pass through the
				 * same flags and stack.
				 */

The extension cube depends on some operator that depend on some function
implementing them, and as the initial dependency delete call is not
explicitly mentioning them, then it behaves as if CASCADE was needed.

Also, \dx+ cube will not show all the operators and functions.  It skips
those that we see in the CASCADE error message listing.  Here's the SQL
query that will list the object with a direct extension dependency
towards the extension, here of OID 16385.

dim=# SELECT pg_catalog.pg_describe_object(classid, objid, 0) AS "Object Description"
dim-# FROM pg_catalog.pg_depend
dim-# WHERE refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass AND refobjid = '16385' AND deptype = 'e'
dim-# ORDER BY 1;

Of course we didn't have that problem when we added extensions in (that
I remember of), so I'm now going to try and find when that did change…

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



view thread (8+ messages)  latest in thread

Message-ID: <m2wre6v9z8.fsf@2ndQuadrant.fr>
Permalink:  ../m2wre6v9z8.fsf@2ndQuadrant.fr/
Also on:    postgresql.org/message-id/m2wre6v9z8.fsf@2ndQuadrant.fr

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: dimitri@2ndQuadrant.fr, umi.tanuki@gmail.com
  Subject: Re: BUG #6172: DROP EXTENSION error without CASCADE
  In-Reply-To: <m2wre6v9z8.fsf@2ndQuadrant.fr>
  References: <201108211644.p7LGibJ1064013@wwwmaster.postgresql.org> <m2wre6v9z8.fsf@2ndQuadrant.fr>

* 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