Create db with template does not transfer ownership

From: Ben Harper <rogojin(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Create db with template does not transfer ownership
Date: 2009-06-29 12:50:14
Message-ID: 6def3e7b0906290550v481994f4if78bd8b95839cef2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Scott Mead 2009-06-29 12:54:40 Re: Terrible Write Performance of a Stored Procedure
Previous Message Ivan Sergio Borgonovo 2009-06-29 12:46:42 Re: Replication and coding good practices