Thread: extensions in 9.1

extensions in 9.1

From
Seb
Date:
Hi,

I'm starting to migrate to 9.1 and see that there's a new mechanism to
install extensions via de "CREATE EXTENSION" command.  It seems very
simple and convenient, but with "CREATE EXTENSION tablefunc" I'm getting
the error:

ERROR:  function "normal_rand" already exists with same argument types

and similar errors when installing the adminpack into the postgres
database.  I'm not sure what I'm missing here.  Any pointers welcome.

Cheers,

--
Seb

Re: extensions in 9.1

From
Tom Lane
Date:
Seb <spluque@gmail.com> writes:
> I'm starting to migrate to 9.1 and see that there's a new mechanism to
> install extensions via de "CREATE EXTENSION" command.  It seems very
> simple and convenient, but with "CREATE EXTENSION tablefunc" I'm getting
> the error:

> ERROR:  function "normal_rand" already exists with same argument types

It sounds like you already have the old "unpackaged" version of that
module installed.  You need to do a one-time conversion to get from that
state to having the objects wrapped in an extension.  For the standard
contrib modules that's done with "CREATE EXTENSION ... FROM unpackaged".

            regards, tom lane

Re: extensions in 9.1

From
Sebastian P. Luque
Date:
On Tue, 20 Sep 2011 11:36:15 -0400,
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Seb <spluque@gmail.com> writes:
>> I'm starting to migrate to 9.1 and see that there's a new mechanism
>> to install extensions via de "CREATE EXTENSION" command.  It seems
>> very simple and convenient, but with "CREATE EXTENSION tablefunc" I'm
>> getting the error:

>> ERROR: function "normal_rand" already exists with same argument types

> It sounds like you already have the old "unpackaged" version of that
> module installed.  You need to do a one-time conversion to get from
> that state to having the objects wrapped in an extension.  For the
> standard contrib modules that's done with "CREATE EXTENSION ... FROM
> unpackaged".

How can I check if this is the case?  I was getting that same error when
trying to install the adminpack onto the postgres database (as postgres
user of course).  If I try "CREATE EXTENSION adminpack FROM unpackaged"
onto the postgres database this way, I get:

ERROR:  extension "adminpack" has no update path from version "unpackaged" to version "1.0"

and "CREATE EXTENSION tablefunc FROM unpackaged" onto the template1
database, I get:

ERROR:  function normal_rand(integer, double precision, double precision) does not exist


--
Seb

Re: extensions in 9.1

From
Tom Lane
Date:
"Sebastian P. Luque" <spluque@gmail.com> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It sounds like you already have the old "unpackaged" version of that
>> module installed.

> How can I check if this is the case?  I was getting that same error when
> trying to install the adminpack onto the postgres database (as postgres
> user of course).  If I try "CREATE EXTENSION adminpack FROM unpackaged"
> onto the postgres database this way, I get:

> ERROR:  extension "adminpack" has no update path from version "unpackaged" to version "1.0"

> and "CREATE EXTENSION tablefunc FROM unpackaged" onto the template1
> database, I get:

> ERROR:  function normal_rand(integer, double precision, double precision) does not exist

Well, maybe you had better explain the history of this database a bit
better.  It seems like you've got a subset of the tablefunc functions
installed; how did that come to be?  And how did the adminpack functions
get in there?  Checking the archives, the reason we didn't bother with
an "unpackaged" upgrade path for adminpack is that it's always installed
its functions into the pg_catalog schema, meaning pg_dump wouldn't dump
them, so they should not have been there after an upgrade.

            regards, tom lane