Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 05BCC9FA4E3 for ; Thu, 16 Aug 2007 12:35:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 44356-01 for ; Thu, 16 Aug 2007 12:35:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mtai04.charter.net (mtai04.charter.net [209.225.8.184]) by postgresql.org (Postfix) with ESMTP id 8A3029F9757 for ; Thu, 16 Aug 2007 12:35:27 -0300 (ADT) Received: from aa02.charter.net ([10.20.200.154]) by mtai04.charter.net (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP id <20070816153518.SYNT12338.mtai04.charter.net@aa02.charter.net>; Thu, 16 Aug 2007 11:35:18 -0400 Received: from [10.0.1.2] (really [66.188.165.91]) by aa02.charter.net with ESMTP id <20070816153513.IWTB26124.aa02.charter.net@[10.0.1.2]>; Thu, 16 Aug 2007 11:35:13 -0400 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: SUPERUSER vs CREATEUSER causes foul 'code smell' Date: Thu, 16 Aug 2007 10:35:13 -0500 To: Joshua_Kramer X-Mailer: Apple Mail (2.752.2) X-Chzlrs: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/143 X-Sequence-Number: 29081 On Aug 16, 2007, at 10:36 , Joshua_Kramer wrote: > In the pg_users view - is there a way to differentiate between a > role with SUPERUSER priveleges, and a user who merely has the > CREATEUSER flag? > > If I want to create a role who can create other roles, but not have > other SUPERUSER priveleges - how can I do that? I think you may be confusing CREATEROLE and CREATEUSER. AIUI, CREATEUSER is a holdover from the pre-role PostgreSQL days, when CREATEUSER implied SUPERUSER. (I may very well be wrong with the explanation, but the effects look the same.) CREATEROLE privilege does not imply SUPERUSER however. test=# create role user_creator with createuser; CREATE ROLE test=# create role role_creator with createrole; CREATE ROLE test=# select rolname, rolsuper, rolcreaterole from pg_roles; rolname | rolsuper | rolcreaterole -----------------------------+----------+--------------- postgres | t | t ... user_creator | t | f role_creator | f | t (By the way, I don't see a pg_users view in v8.2.4. There's a pg_user view and a pg_roles view however. What version are you using?) Michael Glaesemann grzm seespotcode net