CREATE EXTENSION does not seem to work in 9.2

Started by Susan Cassidyabout 12 years ago5 messagesgeneral
Jump to latest
#1Susan Cassidy
susan.cassidy@decisionsciencescorp.com

When I tried to do CREATE EXTENSION IF NOT EXISTS
/usr/pgsql-9.2/share/extension/plpgsql.control with schema public;

it gave me
ERROR: syntax error at or near "EXTENSION"

CREATE LANGUAGE worked just fine. I only tried CREATE EXTENSION because
the manual said that CREATE LANGUAGE was deprecated.

Susan

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Susan Cassidy (#1)
Re: CREATE EXTENSION does not seem to work in 9.2

On 01/21/2014 02:51 PM, Susan Cassidy wrote:

When I tried to do CREATE EXTENSION IF NOT EXISTS
/usr/pgsql-9.2/share/extension/plpgsql.control with schema public;

it gave me
ERROR: syntax error at or near "EXTENSION"

CREATE LANGUAGE worked just fine. I only tried CREATE EXTENSION because
the manual said that CREATE LANGUAGE was deprecated.

If you trying to install plpgsql it is installed by default from 9.0+
If you trying to install something else you only need the extension name
not the file path, so just plpgsql in this case.

Susan

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Susan Cassidy
susan.cassidy@decisionsciencescorp.com
In reply to: Adrian Klaver (#2)
Re: CREATE EXTENSION does not seem to work in 9.2

It wasn't installed in the yum package that we used to install postgres
9.2. I had to add it. As I said, create language worked fine. Before I
did create language, I got errors that the language didn't exist when I
tried to create a function. After I created the language, those errors
went away.

Susan

On Tue, Jan 21, 2014 at 3:05 PM, Adrian Klaver <adrian.klaver@gmail.com>wrote:

Show quoted text

On 01/21/2014 02:51 PM, Susan Cassidy wrote:

When I tried to do CREATE EXTENSION IF NOT EXISTS
/usr/pgsql-9.2/share/extension/plpgsql.control with schema public;

it gave me
ERROR: syntax error at or near "EXTENSION"

CREATE LANGUAGE worked just fine. I only tried CREATE EXTENSION because
the manual said that CREATE LANGUAGE was deprecated.

If you trying to install plpgsql it is installed by default from 9.0+
If you trying to install something else you only need the extension name
not the file path, so just plpgsql in this case.

Susan

--
Adrian Klaver
adrian.klaver@gmail.com

#4Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Susan Cassidy (#3)
Re: CREATE EXTENSION does not seem to work in 9.2

On 01/22/2014 11:07 AM, Susan Cassidy wrote:

It wasn't installed in the yum package that we used to install postgres
9.2. I had to add it. As I said, create language worked fine. Before
I did create language, I got errors that the language didn't exist when
I tried to create a function. After I created the language, those
errors went away.

Right off the bat, let me say I do not use yum, so I am working a bit
blind here.

What distribution are you using yum for and what package did you use?

What does the below show?

createlang -U postgres -d template1 -l

Susan

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Devrim GÜNDÜZ
devrim@gunduz.org
In reply to: Susan Cassidy (#3)
Re: CREATE EXTENSION does not seem to work in 9.2

Hi,

On Wed, 2014-01-22 at 11:07 -0800, Susan Cassidy wrote:

It wasn't installed in the yum package that we used to install
postgres 9.2.

This has nothing to do with the RPMs -- PL/pgSQL is installed by
defaults since 9.0. As Adrian wrote, you will need to omit the file path
there (still, you don't need it with 9.2)

Regards,
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR