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

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

From
"PostgreSQL Bugs List"
Date:
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=>
"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

Re: BUG #1222: database owner should have implicit control

From
Robert Treat
Date:
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

Re: BUG #1222: database owner should have implicit control

From
Fabien COELHO
Date:
> > > 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

Re: BUG #1222: database owner should have implicit control

From
Robert Treat
Date:
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

Re: BUG #1222: database owner should have implicit control

From
Fabien COELHO
Date:
> > "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