Hello all,

I'm using a template database as the base for new database creation. The
user executing this command is a superuser. Here's the SQL statement that
I'm using for creating new databases:

CREATE DATABASE mynewdatabase OWNER someuser TEMPLATE mytemplatedb ENCODING
'UTF8'.

I noticed that all the tables still seem to be owned by the user that
created the template database initially which isn't what I expected. Is
there a step that I'm missing that will allow me to have all the tables /
functions / etc ownership changed also? I'm running postgresql-8.1.

Thanks!

Search Discussions

  • Serge Fonville at Feb 10, 2009 at 2:40 pm
    Hi,

    The user creating the tables, is that the owner of the database or the super
    user?'If it is the super user, you need tot do an ALTER TABLE to change the
    owner.

    Regards,

    Serge Fonville

    On Tue, Feb 10, 2009 at 3:18 PM, Chris McKinney wrote:

    Hello all,

    I'm using a template database as the base for new database creation. The
    user executing this command is a superuser. Here's the SQL statement that
    I'm using for creating new databases:

    CREATE DATABASE mynewdatabase OWNER someuser TEMPLATE mytemplatedb ENCODING
    'UTF8'.

    I noticed that all the tables still seem to be owned by the user that
    created the template database initially which isn't what I expected. Is
    there a step that I'm missing that will allow me to have all the tables /
    functions / etc ownership changed also? I'm running postgresql-8.1.

    Thanks!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedFeb 10, '09 at 2:18p
activeFeb 10, '09 at 2:40p
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Serge Fonville: 1 post Chris McKinney: 1 post

People

Translate

site design / logo © 2022 Grokbase