Re: Need help extripating plpgsql

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need help extripating plpgsql
Date: 2013-02-22 19:59:01
Message-ID: 1361563141.98302.YahooMailNeo@web162902.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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;

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Maz Mohammadi 2013-02-22 20:42:06 Re: confirming security.
Previous Message John R Pierce 2013-02-22 19:35:08 Re: confirming security.