Object ownership in a new database

Поиск
Список
Период
Сортировка
От Russell Smith
Тема Object ownership in a new database
Дата
Msg-id 43F146BA.8010206@pws.com.au
обсуждение исходный текст
Список pgsql-general
Hello all,

When you create a new database, not all objects in that database are
owned by the database owner.  Now some of those may need to be owned by
a superuser, eg C functions.  However should other things such as the
public schema or other general objects be owned by the database owner,
or the user who created them in the template database?

To create a db with the public schema owned by postgres, just:

$ createdb -h 172.17.72.1 -U postgres -O non_superuser owner_test;

$ psql -h 172.17.72.1 -U postgres owner_test;
owner_test=# \dn
         List of schemas
         Name        |  Owner
--------------------+----------
  information_schema | postgres
  pg_catalog         | postgres
  pg_toast           | postgres
  public             | postgres
(4 rows)

owner_test=# \q


Now everything is owned by postgres.

Is this the correct and desired behaviour, or is the behaviour expected
to be different.  I expected it to be owned by "non_superuser".

Any comments welcome.

Russell Smith

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

Предыдущее
От: alexandre - aldeia digital
Дата:
Сообщение: differences between pg_dump and pg_restore with -t
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Limiting with a left outer join