pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6718: Cannot delete, create or check existence of extension
6+ messages / 4 participants
[nested] [flat]

* BUG #6718: Cannot delete, create or check existence of extension
@ 2012-07-04 18:05 gary.haran@gmail.com
  2012-07-05 06:56 ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
  0 siblings, 1 reply; 6+ messages in thread

From: gary.haran@gmail.com @ 2012-07-04 18:05 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6718
Logged by:          Gary Haran
Email address:      gary.haran@gmail.com
PostgreSQL version: 9.1.4
Operating system:   OS X
Description:        

development=# select version();
                                                                    version 
                                                                  
-----------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.1.4 on x86_64-apple-darwin11.4.0, compiled by Apple clang
version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn), 64-bit
(1 row)

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





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6718: Cannot delete, create or check existence of extension
  2012-07-04 18:05 BUG #6718: Cannot delete, create or check existence of extension gary.haran@gmail.com
@ 2012-07-05 06:56 ` Craig Ringer <ringerc@ringerc.id.au>
  2012-07-05 13:06   ` Re: BUG #6718: Cannot delete, create or check existence of extension Gary Haran <gary.haran@gmail.com>
  2012-07-05 14:18   ` Re: BUG #6718: Cannot delete, create or check existence of extension Jaime Casanova <jaime@2ndquadrant.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Craig Ringer @ 2012-07-05 06:56 UTC (permalink / raw)
  To: gary.haran@gmail.com; +Cc: pgsql-bugs

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6718: Cannot delete, create or check existence of extension
  2012-07-04 18:05 BUG #6718: Cannot delete, create or check existence of extension gary.haran@gmail.com
  2012-07-05 06:56 ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
@ 2012-07-05 13:06   ` Gary Haran <gary.haran@gmail.com>
  2012-07-05 13:31     ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
  1 sibling, 1 reply; 6+ messages in thread

From: Gary Haran @ 2012-07-05 13:06 UTC (permalink / raw)
  To: Craig Ringer <ringerc@ringerc.id.au>; +Cc: pgsql-bugs

I installed it using an hstore.sql file that comes with the home brew (
https://github.com/mxcl/homebrew/) version of postgresql on OS X.  Maybe we
missed a step or something in the whole installation process.

We most likely upgraded our pg version at some point (we try to stay with
the times).

Thanks for your help!


 Gary Haran
Phone: 514.909.4947
 [image: Facebook] <http://www.facebook.com/gary.haran; [image:
Twitter]<http://www.twitter.com/garyharan; [image:
LinkedIn] <http://ca.linkedin.com/in/garyharan;



On Thu, Jul 5, 2012 at 2:56 AM, Craig Ringer <ringerc@ringerc.id.au> wrote:

> 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<http://www.postgresql.org/...;
>
> 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
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6718: Cannot delete, create or check existence of extension
  2012-07-04 18:05 BUG #6718: Cannot delete, create or check existence of extension gary.haran@gmail.com
  2012-07-05 06:56 ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
  2012-07-05 13:06   ` Re: BUG #6718: Cannot delete, create or check existence of extension Gary Haran <gary.haran@gmail.com>
@ 2012-07-05 13:31     ` Craig Ringer <ringerc@ringerc.id.au>
  0 siblings, 0 replies; 6+ messages in thread

From: Craig Ringer @ 2012-07-05 13:31 UTC (permalink / raw)
  To: Gary Haran <gary.haran@gmail.com>; +Cc: pgsql-bugs

On 07/05/2012 09:06 PM, Gary Haran wrote:
> I installed it using an hstore.sql file that comes with the home brew 
> (https://github.com/mxcl/homebrew/) version of postgresql on OS X. 
>  Maybe we missed a step or something in the whole installation process.
>
> We most likely upgraded our pg version at some point (we try to stay 
> with the times).
If you upgrade an existing database to 9.1 and that database has contrib 
modules loaded in it, you must convert them to extensions using the 
syntax I gave previously. It's right there in the release notes under 
"Migrating to version 9.1":

http://www.postgresql.org/docs/9.1/static/release-9-1.html#AEN107367

This is a bit of a wart, in that it'd be much nicer to be able to 
transparently re-package pre-extension contrib modules into extensions. 
I know Dimitri and Tom tried to get this working, but it clearly wasn't 
possible to make it work simply and reliably. Since it's a one-off 
migration during upgrade, it isn't that big a deal.

If you need help doing this or you have further questions, please ask 
for help on the pgsql-general mailing list.

--
Craig Ringer

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6718: Cannot delete, create or check existence of extension
  2012-07-04 18:05 BUG #6718: Cannot delete, create or check existence of extension gary.haran@gmail.com
  2012-07-05 06:56 ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
@ 2012-07-05 14:18   ` Jaime Casanova <jaime@2ndquadrant.com>
  2012-07-05 15:09     ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
  1 sibling, 1 reply; 6+ messages in thread

From: Jaime Casanova @ 2012-07-05 14:18 UTC (permalink / raw)
  To: Craig Ringer <ringerc@ringerc.id.au>; +Cc: gary.haran@gmail.com; pgsql-bugs

On Thu, Jul 5, 2012 at 1:56 AM, Craig Ringer <ringerc@ringerc.id.au> wrote:
> On 07/05/2012 02:05 AM, gary.haran@gmail.com wrote:
>>
>> development=# create extension 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.

what about adding a HINT there? something like "you probably need to
use CREATE EXTENSION ... FROM unpackaged"

-- 
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6718: Cannot delete, create or check existence of extension
  2012-07-04 18:05 BUG #6718: Cannot delete, create or check existence of extension gary.haran@gmail.com
  2012-07-05 06:56 ` Re: BUG #6718: Cannot delete, create or check existence of extension Craig Ringer <ringerc@ringerc.id.au>
  2012-07-05 14:18   ` Re: BUG #6718: Cannot delete, create or check existence of extension Jaime Casanova <jaime@2ndquadrant.com>
@ 2012-07-05 15:09     ` Craig Ringer <ringerc@ringerc.id.au>
  0 siblings, 0 replies; 6+ messages in thread

From: Craig Ringer @ 2012-07-05 15:09 UTC (permalink / raw)
  To: Jaime Casanova <jaime@2ndquadrant.com>; +Cc: gary.haran@gmail.com; pgsql-bugs

On 07/05/2012 10:18 PM, Jaime Casanova wrote:
> On Thu, Jul 5, 2012 at 1:56 AM, Craig Ringer <ringerc@ringerc.id.au> wrote:
>> On 07/05/2012 02:05 AM, gary.haran@gmail.com wrote:
>>> development=# create extension 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.
> what about adding a HINT there? something like "you probably need to
> use CREATE EXTENSION ... FROM unpackaged"
>
Yeah, I suggested that. It's not trivial to make sure that this is 
really because of the extension and not because the user just happened 
to create their own type called "hstore" (or whatever the 
type(s)/function(s) the ext provides) are, but I guess with a hint you 
don't have to. I'm assuming if it were simple it would've been done as 
part of extension implementation. It's certainly way beyond me.

--
Craig Ringer




^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2012-07-05 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-07-04 18:05 BUG #6718: Cannot delete, create or check existence of extension gary.haran@gmail.com
2012-07-05 06:56 ` Craig Ringer <ringerc@ringerc.id.au>
2012-07-05 13:06   ` Gary Haran <gary.haran@gmail.com>
2012-07-05 13:31     ` Craig Ringer <ringerc@ringerc.id.au>
2012-07-05 14:18   ` Jaime Casanova <jaime@2ndquadrant.com>
2012-07-05 15:09     ` Craig Ringer <ringerc@ringerc.id.au>

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