BUG #1222: database owner should have implicit control over public db schema

Started by PostgreSQL Bugs Listover 21 years ago6 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

The following bug has been logged online:

Bug reference: 1222
Logged by: radim kolar

Email address: hsn@netmag.cz

PostgreSQL version: 7.4.1

Operating system: freebsd

Description: database owner should have implicit control over public
db schema

Details:

Problem 2

Database owner should have implicit control over public schema
and over all objects in his database as well.

dbmail=> \l
List of databases
Name | Owner | Encoding
------------+-----------+-----------
dbmail | dbmail | SQL_ASCII
template0 | pgsql | SQL_ASCII
template1 | pgsql | SQL_ASCII
dbmail=> SELECT current_user;
current_user
--------------
dbmail
(1 row)
dbmail=> GRANT CREATE on SCHEMA public to public;
ERROR: permission denied for schema public
dbmail=>

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: BUG #1222: database owner should have implicit control over public db schema

"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:

Database owner should have implicit control over public schema
and over all objects in his database as well.

The former is debatable, the latter simply wrong. Make the DB owner a
superuser if you want him to have absolute privileges.

There has been some discussion of causing the public schema to be owned
by the DB owner, but this has not happened yet, partly because we are
not sure of all the consequences.

regards, tom lane

#3Robert Treat
xzilla@users.sourceforge.net
In reply to: Tom Lane (#2)
Re: BUG #1222: database owner should have implicit control

On Tue, 2004-08-17 at 15:02, Tom Lane wrote:

"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:

Database owner should have implicit control over public schema

There has been some discussion of causing the public schema to be owned
by the DB owner, but this has not happened yet, partly because we are
not sure of all the consequences.

was just looking at this this morning. is there anyway to change
ownership of a schema? i couldn't find one and thought i'd ask before
whacking on the system tables.

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

#4Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Robert Treat (#3)
Re: BUG #1222: database owner should have implicit control

Database owner should have implicit control over public schema

There has been some discussion of causing the public schema to be owned
by the DB owner, but this has not happened yet, partly because we are
not sure of all the consequences.

was just looking at this this morning. is there anyway to change
ownership of a schema? i couldn't find one and thought i'd ask before
whacking on the system tables.

"ALTER SCHEMA foo OWNER TO bla" if you're a super user.

--
Fabien Coelho - coelho@cri.ensmp.fr

#5Robert Treat
xzilla@users.sourceforge.net
In reply to: Fabien COELHO (#4)
Re: BUG #1222: database owner should have implicit control

On Wed, 2004-08-18 at 08:57, Fabien COELHO wrote:

Database owner should have implicit control over public schema

There has been some discussion of causing the public schema to be owned
by the DB owner, but this has not happened yet, partly because we are
not sure of all the consequences.

was just looking at this this morning. is there anyway to change
ownership of a schema? i couldn't find one and thought i'd ask before
whacking on the system tables.

"ALTER SCHEMA foo OWNER TO bla" if you're a super user.

And using 8.0... I saw that but was looking for a 7.4 solution...

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

#6Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Robert Treat (#5)
Re: BUG #1222: database owner should have implicit control

"ALTER SCHEMA foo OWNER TO bla" if you're a super user.

And using 8.0... I saw that but was looking for a 7.4 solution...

Maybe: UPDATE pg_namespace SET nspowner=<bla-number> WHERE nspname='foo';

--
Fabien Coelho - coelho@cri.ensmp.fr