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