Create db with template does not transfer ownership - Mailing list pgsql-general

From Ben Harper
Subject Create db with template does not transfer ownership
Date
Msg-id 6def3e7b0906290550v481994f4if78bd8b95839cef2@mail.gmail.com
Whole thread Raw
List pgsql-general
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

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: Replication and coding good practices
Next
From: durumdara
Date:
Subject: Am I in intransaction or in autocommit mode?