Re: Having a problem with RoR-3.1.1 and Pg-9.1

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Having a problem with RoR-3.1.1 and Pg-9.1
Date: 2012-02-28 19:17:07
Message-ID: 4F4D2833.3070703@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/28/2012 10:52 AM, James B. Byrne wrote:

>
> This behaviour effectively means that only the superuser
> can restore databases in 9.1 or build them from scripts;
> unless the default template is altered. Is this desired?
> What then does GRANT CREATE DATABASE mean in 9.1 then? It
> is certainly at odds with the behaviour in 8.x releases.

No, you just did not run into the issue, probably because your template1
was just a straight clone of template0 with no added features

template1=# SELECT version();
version

--------------------------------------------------------------------------------------------------
PostgreSQL 8.4.9 on i686-pc-linux-gnu, compiled by GCC gcc (Ubuntu
4.4.3-4ubuntu5) 4.4.3, 32-bit

template1=# SELECT current_user;
current_user
--------------
postgres

template1=# CREATE TABLE perm_test(id integer, fld_1 text);
CREATE TABLE
template1=# \d
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+----------
public | perm_test | table | postgres

template1=# \du
List of roles
Role name | Attributes | Member of
------------+-------------+--------------
aklaver | Create DB | {production}

template1=# \c - aklaver
psql (8.4.9)
You are now connected to database "template1" as user "aklaver".
template1=> CREATE DATABASE new_database;
CREATE DATABASE
template1=> \l
List of databases
Name | Owner | Encoding | Collation | Ctype |
Access privileges
--------------+----------+----------+-------------+-------------+-----------------------
new_database | aklaver | UTF8 | en_US.UTF-8 | en_US.UTF-8 |

template1=> \c new_database
psql (8.4.9)
You are now connected to database "new_database".
new_database=> \d
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+----------
public | perm_test | table | postgres
(1 row)

The privileges inherit from the template.

>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Gould 2012-02-28 19:23:26 Re: version controlling postgresql code
Previous Message Adrian Klaver 2012-02-28 19:03:11 Re: Having a problem with RoR-3.1.1 and Pg-9.1