pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: christopher-piker@uiowa.edu
To: pgsql-sql@postgresql.org
Subject: Do update permissions require select permissions
Date: 25 Nov 2003 18:00:35 -0800
Message-ID: <14d07696.0311251800.7f5855b7@posting.google.com> (raw)

I have run across a problem while creating a database with row level
permission
checking via views and triggers.  The just of which is update does not
work
for a user unless they also have select permissions.  Select
permissions are handled with a view, while insert, update and delete
permissions are handled via triggers.

The simplest table which demonstrates the problem is:

   create table data_t (id int4, stuff text);
   grant insert,update,delete on data_t to public;

As the table creator issue the query:

   insert into data_t values (1, 'Some stuff');

Now as some other user one can do:

   update data set stuff = 'other stuff';

And it works okay.  But the following fails:

   update data set stuff = 'yet other stuff' where id = 1;

Why is this?  

The reason that I need to not let the user have select on the table is
that
they are only allowed to select certian rows and there is a view that
takes
care of this.  For insert update delete there are trigger functions. 
I know that rules on the view would handle the problem but I am using
inheretence and the query plans grow to over 270 rows when rules on
views on
base tables are put together.



view thread (2+ messages)  latest in thread

Message-ID: <14d07696.0311251800.7f5855b7@posting.google.com>
Permalink:  ../14d07696.0311251800.7f5855b7@posting.google.com/
Also on:    postgresql.org/message-id/14d07696.0311251800.7f5855b7@posting.google.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: christopher-piker@uiowa.edu
  Subject: Re: Do update permissions require select permissions
  In-Reply-To: <14d07696.0311251800.7f5855b7@posting.google.com>

* 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