Owner of schema changes depending on who I logged in with?

$ psql postgres

postgres=# \dn
        List of schemas
        Name        |  Owner
--------------------+----------
 information_schema | postgres
 pg_catalog         | postgres
 pg_toast           | postgres
 pg_toast_temp_1    | postgres
 public             | student
(5 rows)

When I enter psql with the user's postgres, it shows that the publication of the schema belongs to the student of the user. However, when I enter psql with the user's apprentice:

$ psql student

student=> \dn
        List of schemas
        Name        |  Owner
--------------------+----------
 information_schema | postgres
 pg_catalog         | postgres
 pg_toast           | postgres
 pg_toast_temp_1    | postgres
 public             | postgres
(5 rows)

This shows that the publication of the schema belongs to postgres users.

How can I access the public of the scheme passed to the student of the user if the user with privileges for this considers that he has already done?

+4
source share
1 answer

This is a misunderstanding. You enter two different databases .

At startup

$ psql postgres

postgres - . , ident authentication . . - postgres, .

student. public .

psql man psql.

public student, :

psql -U postgres student

( postgres):

psql student

:

ALTER SCHEMA public OWNER TO student;

.

+9

All Articles