Re: CREATE DATABASE foo OWNER bar

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: CREATE DATABASE foo OWNER bar
Date: 2007-04-16 13:52:16
Message-ID: 46237F90.3070501@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2007-04-16 14:10:04 Re: CREATE DATABASE foo OWNER bar
Previous Message Alvaro Herrera 2007-04-16 13:49:10 Re: Build-Problem with pgc.c on OSX 10.4