Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-03 Thread Kevin Kempter
On Wednesday 03 March 2010 08:19:46 am Tom Lane wrote: > Kevin Kempter writes: > > I believe all you have to do is this to create a read only user: > > create user ro_user with password 'passwd'; > > alter user ro_user set default_transaction_read_only = true; > > You do realize the user can just

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-03 Thread Tom Lane
Kevin Kempter writes: > I believe all you have to do is this to create a read only user: > create user ro_user with password 'passwd'; > alter user ro_user set default_transaction_read_only = true; You do realize the user can just unset that again? regards, tom lane --

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-03 Thread Thom Brown
On 3 March 2010 14:51, Kevin Kempter wrote: > On Wednesday 03 March 2010 07:29:21 am Merlin Moncure wrote: >> On Tue, Mar 2, 2010 at 9:56 AM, Thom Brown wrote: >> > As far as I'm aware.  It's only in the upcoming version 9.0 that you >> > can do things like: >> > >> > GRANT SELECT ON ALL TABLES I

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-03 Thread Kevin Kempter
On Wednesday 03 March 2010 07:29:21 am Merlin Moncure wrote: > On Tue, Mar 2, 2010 at 9:56 AM, Thom Brown wrote: > > As far as I'm aware. It's only in the upcoming version 9.0 that you > > can do things like: > > > > GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; > > > > Other folk on

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-03 Thread Merlin Moncure
On Tue, Mar 2, 2010 at 9:56 AM, Thom Brown wrote: > As far as I'm aware.  It's only in the upcoming version 9.0 that you > can do things like: > > GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; > > Other folk on here may have some alternative suggestions though. 9.0 will also have the h

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-03 Thread Nilesh Govindarajan
On Tue, Mar 2, 2010 at 8:26 PM, Thom Brown wrote: > On 2 March 2010 14:49, Antonio Goméz Soto > wrote: > > Op 02-03-10 13:00, Thom Brown schreef: > >> > >> On 2 March 2010 11:46, Nilesh Govindarajan wrote: > >>> > >>> On Tue, Mar 2, 2010 at 4:57 PM, Thom Brown > wrote: > > On 2 March

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Said Ramirez
if you don't want to search the archives, it could just be easier to look at the catalog tables yourself. If you have no experience with them, many times if you do pg_foo when you are interested in 'foo' you will get something, i.e pg_user also exists. #\d pg_tables View "pg_catalog.pg_tables"

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Antonio Goméz Soto
Op 02-03-10 16:14, Raymond O'Donnell schreef: On 02/03/2010 14:56, Thom Brown wrote: But I still need to define access to each table separately? Thanks, Antonio. As far as I'm aware. It's only in the upcoming version 9.0 that you can do things like: GRANT SELECT ON ALL TABLES IN SCHEMA pu

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Raymond O'Donnell
On 02/03/2010 14:56, Thom Brown wrote: >> >> But I still need to define access to each table separately? >> >> Thanks, >> Antonio. >> > > As far as I'm aware. It's only in the upcoming version 9.0 that you > can do things like: > > GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; > > Ot

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Thom Brown
On 2 March 2010 14:49, Antonio Goméz Soto wrote: > Op 02-03-10 13:00, Thom Brown schreef: >> >> On 2 March 2010 11:46, Nilesh Govindarajan  wrote: >>> >>> On Tue, Mar 2, 2010 at 4:57 PM, Thom Brown  wrote: On 2 March 2010 11:12, Antonio Goméz Soto wrote: > > Hi, > >

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Antonio Goméz Soto
Op 02-03-10 13:00, Thom Brown schreef: On 2 March 2010 11:46, Nilesh Govindarajan wrote: On Tue, Mar 2, 2010 at 4:57 PM, Thom Brown wrote: On 2 March 2010 11:12, Antonio Goméz Soto wrote: Hi, I tried this: names=# grant select on database names to spice; ERROR: invalid privilege type SEL

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Craig Ringer
On 2/03/2010 8:00 PM, Thom Brown wrote: CREATE ROLE testuser WITH LOGIN; -- At this point we haven't assigned this user to any group SET ROLE testuser; SELECT * FROM table_a; We get: ERROR: permission denied for relation table_a ... if table_a doesn't have grants to public, which it may wel

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Thom Brown
On 2 March 2010 11:46, Nilesh Govindarajan wrote: > On Tue, Mar 2, 2010 at 4:57 PM, Thom Brown wrote: >> >> On 2 March 2010 11:12, Antonio Goméz Soto >> wrote: >> > Hi, >> > >> > I tried this: >> > >> > names=# grant select on database names to spice; >> > ERROR:  invalid privilege type SELECT f

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Nilesh Govindarajan
On Tue, Mar 2, 2010 at 4:57 PM, Thom Brown wrote: > On 2 March 2010 11:12, Antonio Goméz Soto > wrote: > > Hi, > > > > I tried this: > > > > names=# grant select on database names to spice; > > ERROR: invalid privilege type SELECT for database > > > > The documentation seems to imply I need to

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Thom Brown
On 2 March 2010 11:12, Antonio Goméz Soto wrote: > Hi, > > I tried this: > > names=# grant select on database names to spice; > ERROR:  invalid privilege type SELECT for database > > The documentation seems to imply I need to grant SELECT > to each table separately. That's a lot of work, and what

[GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Antonio Goméz Soto
Hi, I tried this: names=# grant select on database names to spice; ERROR: invalid privilege type SELECT for database The documentation seems to imply I need to grant SELECT to each table separately. That's a lot of work, and what if new tables are created? Thanks, Antonio -- Sent via pgsql-g