Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ... - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
Date
Msg-id CACjxUsNvRsW0rHQ37gLcwe9=ZO4BNFoJE0Rk7YaqDX2JhqM8Aw@mail.gmail.com
Whole thread Raw
In response to Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Responses Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
List pgsql-hackers
On Sat, Sep 10, 2016 at 12:26 AM, Vitaly Burovoy
<vitaly.burovoy@gmail.com> wrote:

> According to the documentation since 9.2 till devel a database can be
> used as a template if it has a "datistemplate" mark or by superusers
> or by their owners.

Hm.  I wonder whether the following failure of "bob" to use the
specified template is intended or a bug.  It seems to make sense to
sort that out before looking at the related tab completion.

test=# checkpoint;
CHECKPOINT
test=# create role fred with createdb;
CREATE ROLE
test=# create user bob;
CREATE ROLE
test=# grant fred to bob;
GRANT ROLE
test=# alter database postgres owner to fred;
ALTER DATABASE
test=# set role fred;
SET
test=> create database db1 template postgres;
CREATE DATABASE
test=> reset role;
RESET
test=# set role bob;
SET
test=> create database db2 template postgres;
ERROR:  permission denied to create database

Opinions on whether this is a bug or correct behavior?

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Useless dependency assumption libxml2 -> libxslt in MSVC scripts
Next
From: Peter Geoghegan
Date:
Subject: Re: Parallel tuplesort (for parallel B-Tree index creation)