Re: public schema owner for newly created database

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: public schema owner for newly created database
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B17CEE791@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на public schema owner for newly created database  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
Thomas Kellerer wrote:
> I usually create new databases with an explicit owner which is the "application user" that is used by
> the application to connect to the database.
> 
> I recently noticed when I do the following:
> 
> postgres=# create user arthur identified by 'secret';
> postgres=# create database guide owner = arthur;
> 
> Then when running \l I do see that the new database is owned by arthur.
> 
> However wenn I connect to the database and use \dn I see that the public schema is owned by "postgres"
> (the user that was used to create the database).
> 
> Due to the default privileges on the public schema this isn't really a problem and I can always change
> the owner for the schema anyway.
> 
> But I would have expected the owner of the database to be the owner of any "object" that is created
> during database initialization.
> 
> Do I have a wrong assumption here?

As far as I know, objects in the database are not created during database
initialization, but they are copied from the template database.
So if "public" is owned by "postgres" in the template database, it will be
the same way in the new database.

Yours,
Laurenz Albe

В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: public schema owner for newly created database
Следующее
От: Rob Emery
Дата:
Сообщение: Synchronous Replication & replay_location