Re: CREATE DATABASE foo OWNER bar - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: CREATE DATABASE foo OWNER bar
Date
Msg-id 46237F90.3070501@dunslane.net
Whole thread Raw
In response to CREATE DATABASE foo OWNER bar  ("Larry Rosenman" <ler@lerctr.org>)
Responses Re: CREATE DATABASE foo OWNER bar
List pgsql-hackers
Larry Rosenman wrote:
> Greetings,
>     I think I found a bug, or at least a POLA violation.  At work, I created
> a user that is NOT a superuser, nor can that user create databases.  When I
> did a create database foo owner bar, all the schemas are set to be owned by
> the superuser that created the database, not the database owner.
>
>     Shouldn't everything that is in the DB be owned by the purported owner?
>
> This is on 8.2.3, btw.
>
> Thanks!
>
>
>   
umm ... objects are initially owned by their creator, no? Ownership of a 
db means you can grant privs over the db, but ownership doesn't cascade. 
If you want your user to own objects you should arrange for that user to 
create them, or run ALTER objtype foo OWNER TO username. The latter is 
what pg_dump does.

cheers

andrew




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Build-Problem with pgc.c on OSX 10.4
Next
From: Larry Rosenman
Date:
Subject: Re: CREATE DATABASE foo OWNER bar