SET Show full PostgreSQL version. version --------------------------------------------------------------- PostgreSQL 7.3.4 on i686-pc-linux-gnu, compiled by GCC 2.95.3 (1 запись) Create user with name user1 CREATE USER Create user with name user2 CREATE USER Switch to user1 with set session authrization SET user1 creates private table with name user1_table CREATE TABLE and revokes all rights on it from public. REVOKE Next user1 creates private view for table user1_table with name user1_view and appropriate insert, update and delete rules on it. CREATE VIEW CREATE RULE CREATE RULE CREATE RULE and revokes all rights on it from public. REVOKE Switch to user2 with set session authrization SET user2 tries to select data from user1_table. Must be error becouse user2 don't have SELECT privilege on user1_table and this is true. This is good. psql:privileges_test.sql:51: ERROR: user1_table: permission denied user2 tries to insert data into user1_table. Must be error becouse user2 don't have INSERT privilege on user1_table and this is true. This is good. psql:privileges_test.sql:57: ERROR: user1_table: permission denied user2 tries to update data in user1_table. Must be error becouse user2 don't have UPDATE privilege on user1_table and this is true. This is good. psql:privileges_test.sql:63: ERROR: user1_table: permission denied user2 tries to delete data from user1_table. Must be error becouse user2 don't have DELETE privilege on user1_table and this is true. This is good. psql:privileges_test.sql:69: ERROR: user1_table: permission denied user2 tries to select data from user1_view. Must be error becouse user2 don't have SELECT privilege on user1_view and this is true. This is good. psql:privileges_test.sql:75: ERROR: user1_view: permission denied user2 tries to insert data into user1_view. Must be error becouse user2 don't have INSERT privilege on user1_view but this is false. This is WRONG!!!! INSERT 16990 1 user2 tries to update data in user1_view. Must be error becouse user2 don't have UPDATE privilege on user1_view and this is true. This is good. psql:privileges_test.sql:87: ERROR: user1_view: permission denied user2 tries to delete data from user1_view. Must be error becouse user2 don't have DELETE privilege on user1_view but this is false. This is WRONG!!!! DELETE 1 Switch back to user1 with set session authrization SET user1 grants SELECT privilege on user1_view to user2 GRANT Switch back to user2 with set session authrization SET user2 tries to select data from user1_view. Must be ok becouse user2 has SELECT privilege on user1_view and this is true. This is good. data ------ (записей: 0) user2 tries to insert data into user1_view. Must be error becouse user2 don't have INSERT privilege on user1_view but this is false. This is WRONG!!!! INSERT 16991 1 user2 tries to update data in user1_view. Must be error becouse user2 don't have UPDATE privilege on user1_view but this is false. This is WRONG!!!! This is also very strange becouse user1 grants SELECT privelege on user1_view to user2 but he also gets UPDATE privelege on it. UPDATE 1 user2 tries to delete data from user1_view. Must be error becouse user2 don't have DELETE privilege on user1_view but this is false. This is WRONG!!!! DELETE 1