how do I grant select to one user for all tables in a DB? - Mailing list pgsql-general

From Gauthier, Dave
Subject how do I grant select to one user for all tables in a DB?
Date
Msg-id 0AD01C53605506449BA127FB8B99E5E13E11699D@FMSMSX105.amr.corp.intel.com
Whole thread Raw
Responses Re: how do I grant select to one user for all tables in a DB?  (Chris Angelico <rosuav@gmail.com>)
Re: how do I grant select to one user for all tables in a DB?  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-general

V9.1.5 on linux

 

User "select" created (yup, that's right, they want the user name to be "select".  Guess what ptivs it is to have! Don't kill the messanger :-) )

 

postgres=# grant select on all tables in schema sde to "select";

ERROR:  schema "sde" does not exist

postgres=# \l

                              List of databases

   Name    |  Owner  | Encoding | Collate |    Ctype    |  Access privileges

-----------+---------+----------+---------+-------------+---------------------

postgres  | pgdbadm | UTF8     | C       | en_US.UTF-8 |

sde       | pgdbadm | UTF8     | C       | en_US.UTF-8 |

template0 | pgdbadm | UTF8     | C       | en_US.UTF-8 | =c/pgdbadm         +

           |         |          |         |             | pgdbadm=CTc/pgdbadm

template1 | pgdbadm | UTF8     | C       | en_US.UTF-8 | =c/pgdbadm         +

           |         |          |         |             | pgdbadm=CTc/pgdbadm

(4 rows)

 

postgres=# \du

                             List of roles

Role name |                   Attributes                   | Member of

-----------+------------------------------------------------+-----------

insert    |                                                | {}

pgdbadm   | Superuser, Create role, Create DB, Replication | {}

select    |                                                | {}

 

Bottom line is that I want this "select" user to be able to query all tables yet to be created in the DB without having to issue grant statments after table craation.  But just select, no more.

 

Thanks in Advance !

pgsql-general by date:

Previous
From: Kenneth Tilton
Date:
Subject: Re: How get column-wise table info from an arbitrary query?
Next
From: daniel
Date:
Subject: ts_headline and query with hyphen