Durgamahesh Manne <maheshpostgres9@gmail.com> writes:
> On Thu, Apr 4, 2019 at 5:55 PM Patrick FICHE <Patrick.Fiche@aqsacom.com>
> wrote:
>> If I’m not wrong, UPDATE requires SELECT permission as the UPDATE
>> statement needs to read the data to be updated.
> in 9.3 version Grant access on update command is worked EVEN I DID NOT
> EXECUTE THIS GRANT SELECT ON TABLE(hyd) for non superuser
I don't think so.
regression=# create table t1 (f1 int, f2 int);
CREATE TABLE
regression=# create user joe;
CREATE ROLE
regression=# grant update on table t1 to joe;
GRANT
regression=# \c - joe
You are now connected to database "regression" as user "joe".
regression=> update t1 set f1 = 1;
UPDATE 0
regression=> update t1 set f1 = 1 where f2 = 3;
ERROR: permission denied for relation t1
regression=> select version();
version
----------------------------------------------------------------------------------------------------------------
PostgreSQL 9.3.25 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23), 64-bit
(1 row)
It's acted that way for a very very long time.
regards, tom lane