Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIjfU-0005YD-PW for pgsql-general@arkaria.postgresql.org; Sat, 25 Nov 2017 23:15:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIjfS-0007iM-TF for pgsql-general@arkaria.postgresql.org; Sat, 25 Nov 2017 23:15:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eIjfS-0007hk-Io for pgsql-general@lists.postgresql.org; Sat, 25 Nov 2017 23:15:26 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eIjfJ-00016K-3f for pgsql-general@lists.postgresql.org; Sat, 25 Nov 2017 23:15:22 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id vAPNF8l06071 for ; Sat, 25 Nov 2017 15:15:09 -0800 Subject: Re: Roles and security To: pgsql-general@lists.postgresql.org References: From: John R Pierce Message-ID: Date: Sat, 25 Nov 2017 15:15:03 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/25/2017 12:03 PM, nikhil raj wrote: >  check the roles of user I want to give user roles only select, > insert, update, execute and create database to all users Permission > those permissions can be assigned on a table by table basis, except create database, thats a special permission.    if you own a database (the creator owns it by default) then you can drop it, if you don't, you can't. > > The users should not have these permission >  drop database , delete table permission generally the owners of objects can grant/revoke permissions on said objects. > > > **(Example --like in MS SQL we have like DB_roles-- ddladmin,data > writer,data reader ,etc like these do we have in postgres).*** you could create roles like these, make users members of these roles,a nd grant permissions to the roles. for more information, see https://www.postgresql.org/docs/current/static/user-manag.html https://www.postgresql.org/docs/current/static/sql-grant.html https://www.postgresql.org/docs/current/static/sql-revoke.html https://www.postgresql.org/docs/current/static/sql-alterdefaultprivileges.html -- john r pierce, recycling bits in santa cruz