This page in other versions: 9.0 / 9.1 / 9.2 / 9.3 / 9.4  |  Development versions: devel  |  Unsupported versions: 7.1 / 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3 / 8.4

Chapter 18. Database Roles and Privileges

Table of Contents
18.1. Database Roles
18.2. Role Attributes
18.3. Privileges
18.4. Role Membership
18.5. Functions and Triggers

PostgreSQL manages database access permissions using the concept of roles. A role can be thought of as either a database user, or a group of database users, depending on how the role is set up. Roles can own database objects (for example, tables) and can assign privileges on those objects to other roles to control who has access to which objects. Furthermore, it is possible to grant membership in a role to another role, thus allowing the member role use of privileges assigned to the role it is a member of.

The concept of roles subsumes the concepts of "users" and "groups". In PostgreSQL versions before 8.1, users and groups were distinct kinds of entities, but now there are only roles. Any role can act as a user, a group, or both.

This chapter describes how to create and manage roles and introduces the privilege system. More information about the various types of database objects and the effects of privileges can be found in Chapter 5.

Comments


April 18, 2007, 3:18 p.m.

To create random passwords with a query:

select substring(encode(decode(md5(random()::text),'hex'),'base64') from 1 for 8)

It uses a rondomized order of a-z A-Z 0-9 and + /

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group