BUG #5147: DBA can not access view

From: "Dongni" <donniehan(at)126(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5147: DBA can not access view
Date: 2009-10-29 09:38:18
Message-ID: 200910290938.n9T9cIxN077254@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5147
Logged by: Dongni
Email address: donniehan(at)126(dot)com
PostgreSQL version: 8.4.0
Operating system: WindowsXP 32bit
Description: DBA can not access view
Details:

Please fyi the following test case

postgres=# create user user1;
CREATE ROLE
postgres=# create user user2;
CREATE ROLE
postgres=# set session authorization user1;
SET
postgres=> create table tb1(a int);
CREATE TABLE
postgres=> set session authorization user2;
SET
postgres=> create table tb2(b int);
CREATE TABLE
postgres=> set session authorization user1;
SET
postgres=> create view view1 as select tb1.a,tb2.b from tb1,tb2;
CREATE VIEW
postgres=> reset session authorization;
RESET
postgres=# select * from view1;
ERROR: permission denied for relation tb2
postgres=# select * from tb2;
b
---
(0 rows)
postgres=# select * from pg_user where usename='postgres'
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd |
valuntil | useconfig
----------+----------+-------------+----------+-----------+----------+------
----+-----------
postgres | 10 | t | t | t | ******** |
|

In my opinion, "postgres" as super user should be able to access any object
in the database. The document says "A database superuser bypasses all
permission checks".
But in this case, postgres can not select from the view view1. Please
confirm whether it is a bug or this behavor is by design.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-10-29 13:34:40 Re: BUG #5147: DBA can not access view
Previous Message xqzhang 2009-10-29 08:42:47 BUG #5146: After granting all select privelges on view to user, who still can not select the view