Re: Question about permissions on database.

From: David Johnston <polobo(at)yahoo(dot)com>
To: Condor <condor(at)stz-bg(dot)com>
Cc: "<pgsql-general(at)postgresql(dot)org>" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about permissions on database.
Date: 2012-09-22 20:55:21
Message-ID: 210D2B06-D1E6-4C4E-9CE9-374B377967D0@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sep 22, 2012, at 16:35, Condor <condor(at)stz-bg(dot)com> wrote:

> Hello,
> I wanna ask: is there a short way to giver permission to one user to select/insert (all privileges) on whole database ?
> Im create a user and try to give him all permission on existing database, but when I try to select always got:
> ERROR: permission denied for relation table_name
>
> I simple do:
> GRANT ALL PRIVILEGES ON DATABASE my_db TO my_user;
> and when I do that my idea and what Im trying to do is to give all privileges on for select, insert, update ... using sequences, exec functions
> to one user, but when I try to select, I receive error message:
> ERROR: permission denied for relation table_name
>
> I look at documentation and remained less scarred about how many grants I should do for tables, for sequences, execution.
> Im using postgresql 9.2
>

Each object type needs to be handled independently. A database is a distinct object type with its own actions to allow/disallow (mainly connect, usage?). You need to issue similar commands for schemas, tables, functions, etc...

Would suggest creating group (i.e., non-login) roles and grant to those then make the user (i.e., login) roles a member of the appropriate group role(s).

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Angelico 2012-09-22 23:22:11 Re: Question about permissions on database.
Previous Message Ryan Kelly 2012-09-22 20:47:00 Re: Question about permissions on database.