pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Eugene Karpachov <jk@steel.orel.ru>
To: pgsql-general@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: grant select,update - bug or feature?
Date: Mon, 29 May 2000 15:19:09 +0400
Message-ID: <20000529151909.A10272@steel.orel.ru> (raw)

Excuse me for my bad English.

Let us create test database as superuser:

create table master ( i integer primary key, a text);
	-- I want to protect this table from updating by 'dbuser'
	
create table slave ( j integer references master, b text);
	-- I want to enable updating this table by 'dbuser' 
	
grant select on master to dbuser;
grant select,update on slave to dbuser;

-- populating tables with sample values:
insert into master (i,a) values (1,'one');
insert into master (i,a) values (2,'two');
insert into slave (j,b) values (1,'ONE');

By now, all is ok.


Then, running psql as 'dbuser':

jk=> update slave set b='four';
ERROR:  master: Permission denied.

Why dbuser need 'update' permissions on 'master' table? I only want to
update 'slave' table.

If superuser grants update on master to dbuser, all works.

-- 
jk



view thread (2+ messages)  latest in thread

Message-ID: <20000529151909.A10272@steel.orel.ru>
Permalink:  ../20000529151909.A10272@steel.orel.ru/
Also on:    postgresql.org/message-id/20000529151909.A10272@steel.orel.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jk@steel.orel.ru, pgsql-general@postgresql.org
  Subject: Re: grant select,update - bug or feature?
  In-Reply-To: <20000529151909.A10272@steel.orel.ru>
  References: <20000529151909.A10272@steel.orel.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox