Thread: Create db with template does not transfer ownership

Create db with template does not transfer ownership

From
Ben Harper
Date:
I'm trying to create a PostGIS database by using

CREATE DATABASE mydb TEMPLATE template_postgis;

using the Windows one-click installer package, with PostGIS 1.3 /
Postgres 8.3.7.

But my question is more general:
When a new database is created base on a template, the owner of those
tables is not changed. The owner of the copied tables remains the
original owner in the template. This leaves the owner of the new DB
unable to access those tables. The end result is that you cannot use a
system-wide template database, unless you want to grant full access to
these tables. Should the action of the 'TEMPLATE' option not be to
transfer ownership to the owner of the new DB? I don't understand how
one is supposed to use this mechanism.

Thanks,
Ben