Other user access to database

Started by Glenn Sullivanover 27 years ago3 messagesgeneral
Jump to latest
#1Glenn Sullivan
glenn.sullivan@nmr.varian.com

Now that I have a database functional, I need to allow other users
to have access. Using createuser I can give other users access to
the postmaster, but I need to give them access to my database as well.

Could someone enlighten me.

Glenn

#2Bob Dusek
bobd@palaver.net
In reply to: Glenn Sullivan (#1)
Re: [GENERAL] Other user access to database

Well,

You can grant specific (read, write, etc..) permissions for the tables in
your database to any legitimate user recognized by postgres (ie. users
created with the createuser command). I am unsure as to how to grant
specific permissions on an entire database.

to see how to grant/revoke table premissions:

database_prompt=> \h grant
Command: grant
Description: grant access control to a user or group
Syntax:
grant <privilege[,privilege,...]> on <rel1>[,...<reln>] to
[public | group <group> | <username>]
privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}

database_prompt=> \h revoke
Command: revoke
Description: revoke access control from a user or group
Syntax:
revoke <privilege[,privilege,...]> on <rel1>[,...<reln>] from
[public | group <group> | <username>]
privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}

Hope this helps,

Bob

On Tue, 8 Dec 1998, Glenn Sullivan wrote:

Show quoted text

Date: Tue, 08 Dec 1998 11:55:18 -0700
From: Glenn Sullivan <glenn.sullivan@nmr.varian.com>
To: pgsql-general@hub.org
Subject: [GENERAL] Other user access to database

Now that I have a database functional, I need to allow other users
to have access. Using createuser I can give other users access to
the postmaster, but I need to give them access to my database as well.

Could someone enlighten me.

Glenn

#3Bryan White
bryan@arcamax.com
In reply to: Bob Dusek (#2)
Re: [GENERAL] Other user access to database

Now that I have a database functional, I need to allow other users
to have access. Using createuser I can give other users access to
the postmaster, but I need to give them access to my database as well.

Could someone enlighten me.

Access to tables is controled with the Grant and Revoke SQL statements.

From memory try:

grant OPERATION on TABLENAME to USER;

where

OPERATION is one of SELECT, UPDATE, DELETE, INSERT or ALL for all
operations.

TABLENAME is a comma separated list of tables.

USER is a comma separated list of users or the keyword PUBLIC.