BUG #4792: odd behavior revoking perms on an owned table - Mailing list pgsql-bugs

From toni garcia
Subject BUG #4792: odd behavior revoking perms on an owned table
Date
Msg-id 200905050959.n459xxhe060108@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4792: odd behavior revoking perms on an owned table
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4792
Logged by:          toni garcia
Email address:      agarcia@at4.net
PostgreSQL version: 8.2.7
Operating system:   gentoo linux
Description:        odd behavior revoking perms on an owned table
Details:

Sorry, I cannot test on 8.2.13, but I'm including full SQL so you can
quickly try reproducing the bug:

#psql -U postgres template1

CREATE DATABASE test_db;
CREATE USER test_user;
\c test_db test_user
CREATE TABLE test (id integer primary key);
CREATE TABLE test_fk (id integer primary key, testid integer, constraint fk1
foreign key (testid) references test(id));
REVOKE UPDATE ON test FROM test_user ;
INSERT INTO test VALUES (1);
INSERT INTO test_fk VALUES (1,1);

Last sentence fails with message:
ERROR:  permiso denegado para la relaciest
CONTEXT:  sentencia SQL: «SELECT 1 FROM ONLY "public"."test" x WHERE "id" =
$1 FOR SHARE OF x»

If you change owner for table 'test' then it works:

\c - postgres
ALTER TABLE test OWNER TO postgres;
\c - test_user
INSERT INTO test_fk VALUES (1,1);

pgsql-bugs by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: BUG #4791: NULL value in function causes reproducible segmentation fault
Next
From: Christian Iversen
Date:
Subject: Re: BUG #4791: NULL value in function causes reproducible segmentation fault