pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: gary.haran@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6718: Cannot delete, create or check existence of extension
Date: Thu, 05 Jul 2012 14:56:59 +0800
Message-ID: <4FF53ABB.4060209@ringerc.id.au> (raw)
In-Reply-To: <E1SmTwp-0006YP-1E@wrigleys.postgresql.org>
References: <E1SmTwp-0006YP-1E@wrigleys.postgresql.org>

On 07/05/2012 02:05 AM, gary.haran@gmail.com wrote:
> development=# create extension hstore;
> ERROR:  type "hstore" already exists
> development=# drop extension hstore;
> ERROR:  extension "hstore" does not exist
> development=# CREATE EXTENSION IF NOT EXISTS hstore;
> ERROR:  type "hstore" already exists

First, thanks for the info in the report.

At a guess, it has the hstore data type in it from before the extension 
system exists. You need to follow the upgrade instructions to convert it 
to an extension. This isn't a bug in that Pg is working as designed, 
though it's certainly not very nice user interface.

See:

   http://www.postgresql.org/docs/9.1/static/sql-createextension.html

specifically the "FROM old_version" clause, eg:

   CREATE EXTENSION hstore FROM unpackaged;

(I think that's right; I haven't used the extension system in an upgrade).

If you need more help please ask on pgsql-general as this doesn't appear 
to be a bug from the information supplied. However, I think "CREATE 
EXTENSION" should emit a HINT for already-exists errors, guiding people 
to info on how to upgrade the extension.

I'm assuming the database "development" was loaded from a dump from an 
older version or was binary-upgraded from an older version. If it was 
created anew on 9.1, how did the "hstore" type get loaded?

--
Craig Ringer



view thread (6+ messages)  latest in thread

Message-ID: <4FF53ABB.4060209@ringerc.id.au>
Permalink:  ../4FF53ABB.4060209@ringerc.id.au/
Also on:    postgresql.org/message-id/4FF53ABB.4060209@ringerc.id.au

 · 

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: ringerc@ringerc.id.au, gary.haran@gmail.com
  Subject: Re: BUG #6718: Cannot delete, create or check existence of extension
  In-Reply-To: <4FF53ABB.4060209@ringerc.id.au>
  References: <E1SmTwp-0006YP-1E@wrigleys.postgresql.org> <4FF53ABB.4060209@ringerc.id.au>

* 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