Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ts0Aq-0001bD-Oj for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 00:02:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ts0Ap-0001Le-PV for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2013 00:02:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ts0Ap-0001LH-03 for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 00:02:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ts0Am-0002T5-1U for pgsql-bugs@postgresql.org; Mon, 07 Jan 2013 00:02:38 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r0702Ws8009601; Sun, 6 Jan 2013 19:02:33 -0500 (EST) From: Tom Lane To: zardozwildman@hotmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7791: create database with owner, owner does not get usage on schema In-reply-to: References: Comments: In-reply-to zardozwildman@hotmail.com message dated "Sun, 06 Jan 2013 06:14:04 +0000" Date: Sun, 06 Jan 2013 19:02:32 -0500 Message-ID: <9600.1357516952@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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