Thread: extension installation PB

extension installation PB

From
"Jean-Yves F. Barbier"
Date:
Debian sid - Pg v.9.1.1-3
=========================
Hi list,

I've an old script installing Pg extensions that I modified to fit
from 9.1 paths & file names.
However it throw errors for any extension package, ie:

=# \i /usr/share/postgresql/9.1/extension/adminpack--1.0.sql
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:12: ERROR:  could not access file "MODULE_PATHNAME": No
suchfile or directory 
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:17: ERROR:  could not access file "MODULE_PATHNAME": No
suchfile or directory 
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:22: ERROR:  function pg_catalog.pg_file_rename(text, text,
text)does not exist 
LIGNE 3 : AS 'SELECT pg_catalog.pg_file_rename($1, $2, NULL::pg_catalo...
                     ^
ASTUCE : No function matches the given name and argument types. You might need to add explicit type casts.
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:27: ERROR:  could not access file "MODULE_PATHNAME": No
suchfile or directory 
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:32: ERROR:  could not access file "MODULE_PATHNAME": No
suchfile or directory 
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:40: ERROR:  function "pg_file_read" already exists with
sameargument types 
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:45: ERROR:  function "pg_file_length" already exists with
sameargument types 
psql:/usr/share/postgresql/9.1/extension/adminpack--1.0.sql:50: ERROR:  function "pg_logfile_rotate" already exists
withsame argument types 

What's wrong?

JY
--
A countryman between two lawyers is like a fish between two cats.
        -- Ben Franklin

Re: extension installation PB

From
Devrim GÜNDÜZ
Date:
On Sun, 2011-11-06 at 19:58 +0100, Jean-Yves F. Barbier wrote:
>
> I've an old script installing Pg extensions that I modified to fit
> from 9.1 paths & file names.
> However it throw errors for any extension package, ie:
>
> =# \i /usr/share/postgresql/9.1/extension/adminpack--1.0.sql

As of 9.1, you cannot run those files via \i. Now there is a simpler
way:

CREATE EXTENSION adminpack;

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

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Attachment

Re: extension installation PB

From
Tom Lane
Date:
"Jean-Yves F. Barbier" <12ukwn@gmail.com> writes:
> I've an old script installing Pg extensions that I modified to fit
> from 9.1 paths & file names.

As of 9.1, extension script files are not meant to be read directly.
They typically will fail, and if you found one that didn't fail,
executing it directly would still be the wrong thing because the
SQL objects wouldn't get bundled into an extension.

Use the CREATE EXTENSION command, instead.

            regards, tom lane