Re: Roles and security

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: nikhil raj <nikhilraj474(at)gmail(dot)com>, pgsql-jobs(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)com, pgsql-novice(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Roles and security
Date: 2017-11-26 15:18:53
Message-ID: 1511709533.2396.5.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice pgsql-sql

nikhil raj wrote:
> Currently my company is shifting from MS SQL to postgres
>
> check the roles of user I want to give user roles only select, insert, update, execute and create database to all users Permission
>
>
> The users should not have these permission
> drop database , delete table permission

If you want to allow a user (or role) CREATE DATABASE, give them the
CREATEDB privilege with ALTER ROLE.

If you mean "schema" when you say "database", give them the CREATE
privilege on the database instead.

SELECT, INSERT, UPDATE and EXECUTE are granted on individual objects,
not in general.

You can, however, use ALTER DEFUALT PRIVILEGES to automatically grant
privieges on any new object created.

Note that by default, everybody (the special role PUBLIC) has EXECUTE
privilege on all functions.

Only superusers and object owners are allowed DROP and ALTER on objects,
and there is no way to prevent that.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message chandra sekhar 2017-11-26 16:54:40 equalant of msdb in sql server
Previous Message Tomas Guerra 2017-11-26 14:11:21 Error installing PostgreSQL 8.3 (password short, not complex)

Browse pgsql-novice by date

  From Date Subject
Next Message Dale Schmitz 2017-11-26 22:25:40 Novice question about users and...rights?
Previous Message Andreas Kretschmer 2017-11-26 11:27:03 Re: A particular database to move to other drive

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Joseph Krogh 2017-11-28 17:54:47 Not counting duplicates of declared pratition in OVER()-clause
Previous Message John R Pierce 2017-11-25 23:15:03 Re: Roles and security