Search Postgresql Archives

Object ownership in a new database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux