Re: Need help extripating plpgsql - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Need help extripating plpgsql
Date
Msg-id 5127E59F.9010009@gmail.com
Whole thread Raw
In response to Re: Need help extripating plpgsql  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: Need help extripating plpgsql  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-general
On 02/22/2013 11:59 AM, Kevin Grittner wrote:
> Adrian Klaver <adrian.klaver@gmail.com> wrote:
>
>> At this point I am not sure how to do this with out creating role
>> that has superuser privileges.
>
> Something like this?:
>
> -- Set up the template using database superuser.
> create database template2;
> \c template2
> drop extension plpgsql;
> vacuum freeze analyze;
> \c postgres
> update pg_database set datistemplate = true
>    where datname = 'template2';
> checkpoint;
>
> -- Create a user who can own the database and plpgsql.
> create user bob with createdb;
> set role bob;
> create database bob template template2;
> \c bob
> create extension plpgsql;

If you do as above plpgsql is created as with owner postgres.

To get owner to be bob you need to do:

\c bob
set role bob;
create extension plpgsql;


Either way you still get the error on the COMMENT which is what is
tripping up the OP.

>
> --
> Kevin Grittner
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>


--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Alejandro Carrillo
Date:
Subject: ...
Next
From: Kevin Grittner
Date:
Subject: Re: Need help extripating plpgsql