Skip site navigation (1) Skip section navigation (2)

Re: 9.1rc1 bug: extension types not dropped with DROP SCHEMA CASCADE

From: Thom Brown <thom(at)linux(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.1rc1 bug: extension types not dropped with DROP SCHEMA CASCADE
Date: 2011-09-10 12:13:51
Message-ID: CAA-aLv5NYE2GtmNozBQQCOuduDqZ79kPL8HwKbxtR4eMu818Vg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 10 September 2011 12:46, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> Hi!
>
> Creating an extension in a schema and then dropping that schema
> apparently doesn't clean up the extension's types:
> db=# CREATE SCHEMA foo;
> db=# CREATE EXTENSION cube WITH SCHEMA foo;
> db=# DROP SCHEMA foo CASCADE;
> NOTICE:  drop cascades to 6 other objects
> DETAIL:  drop cascades to operator foo.<>(foo.cube,foo.cube)
> drop cascades to operator foo.>(foo.cube,foo.cube)
> drop cascades to operator foo.<=(foo.cube,foo.cube)
> drop cascades to operator foo.>=(foo.cube,foo.cube)
> drop cascades to operator foo.<@(foo.cube,foo.cube)
> drop cascades to operator foo.~(foo.cube,foo.cube)
>
> It leaves around pg_type entry with typnamespace that doesn't exist in
> pg_namespace:
>
> db=# select * from pg_type left join pg_namespace ns on
> (typnamespace=ns.oid) where ns.oid is null;
> * Record 1
> typname        _cube
> typnamespace   17074
> typowner       10
> typlen         -1
> ...
>
> Also breaks pg_dump: "pg_dump: schema with OID 17074 does not exist"

I can confirm the problem in 9.1rc1, but it's fine when testing it on
9.1.0 which is out on Monday, and Git master.

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2011-09-10 12:44:50
Subject: Re: 9.1rc1 bug: extension types not dropped with DROP SCHEMA CASCADE
Previous:From: Amit kapilaDate: 2011-09-10 12:04:36
Subject: Re: cheaper snapshots redux

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group