Re: Need SELECT rights to UPDATE/DELETE WHERE?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cpp(at)world-online(dot)no
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Need SELECT rights to UPDATE/DELETE WHERE?
Date: 2005-02-01 05:34:31
Message-ID: 10344.1107236071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

cpp(at)world-online(dot)no writes:
> In my hands it looks like a user with INSERT/DELETE/UPDATE rights on table1
> cannot do "update table1 set field1=xx where field2=yy" without also being
> granted select rights. However, the user can do "update table1 set field1=xx".
> Is this right?

Yes. Otherwise you can use UPDATEs to infer something about the content
of the table, eg do
update table1 set field1 = field1 where field2 = yy
and note the result count to find out whether there are any rows with
field2 = yy. If you didn't give the other guy SELECT rights then
presumably you do not want him to be able to infer any such thing.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message imam 2005-02-01 07:14:50 problem while converting sybase quries to postgres
Previous Message Iain 2005-02-01 04:54:09 Re: