pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: zardozwildman@hotmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7791: create database with owner, owner does not get usage on schema
Date: Sun, 06 Jan 2013 19:02:32 -0500
Message-ID: <9600.1357516952@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TrjUi-0007ep-BQ@wrigleys.postgresql.org>
References: <E1TrjUi-0007ep-BQ@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

zardozwildman@hotmail.com writes:
> This database creation script was executed via the postgres superuser.
> Executes create database and the "with owner" clause.
> Create database assigns ownership to a role (myta_admin_role). This is not a
> login role.
> After database creation, script creates a schema. I later discovered that
> the role never gets usage permission on the schema. Even though it is the
> database owner.

This isn't a bug.  A database owner just owns the database (and hence
can rename or drop it).  The owner doesn't magically have additional
permissions on the objects therein.  It'd be a security hole if he did,
at least for superuser-owned objects such as the core functions and
operators ... and I gather that you created this schema as superuser.

We could argue about whether database owners should have extra
privileges on objects belonging to ordinary users, but it'd be rather
inconsistent to do that IMO.  It makes more sense for the object owner
to have to grant privileges to the database owner, if the latter is to
be able to access the object.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <9600.1357516952@sss.pgh.pa.us>
Permalink:  ../9600.1357516952@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9600.1357516952@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zardozwildman@hotmail.com
  Subject: Re: BUG #7791: create database with owner, owner does not get usage on schema
  In-Reply-To: <9600.1357516952@sss.pgh.pa.us>
  References: <E1TrjUi-0007ep-BQ@wrigleys.postgresql.org> <9600.1357516952@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox