Re: pg_database datistemplate - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_database datistemplate
Date
Msg-id 14393.1035491991@sss.pgh.pa.us
Whole thread Raw
In response to pg_database datistemplate  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: pg_database datistemplate  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-hackers
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> In the docs it is mentioned for datistemplate that
> "If true then this database can be used in the "TEMPLATE" clause of
> CREATE DATABASE to create the new database as a clone of this one."

Right.

> However, one can create a database using as template another DB that has
> datistemplate set to false.

Only if one is owner of the source database (or superuser).

> In this situation, what is the point of having datistemplate?

Effectively, it's a "grant right to copy" flag.

Now that we have per-database ACLs, we should probably replace
datistemplate with an access right; instead of setting it you'd
do something like GRANT COPY ON DATABASE foo TO PUBLIC.

(We'd also talked about replacing datallowconn with an access right,
although that is more likely to break existing apps, since a fair
number of them look at datallowconn.)

Too late for 7.3 though ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: korry
Date:
Subject: Re: pg_database datistemplate
Next
From: cbbrowne@cbbrowne.com
Date:
Subject: Re: Hot Backup