REVOKE CREATE does not work on default tablespace - Mailing list pgsql-bugs

From Zdenek Kotala
Subject REVOKE CREATE does not work on default tablespace
Date
Msg-id 467FC912.1090509@sun.com
Whole thread Raw
Responses Re: REVOKE CREATE does not work on default tablespace  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I try to revoke create privileges (PG8.2.4) on the default tablespace and I
found following strange behavior:


----------------
As superuser:

revoke create on TABLESPACE pg_default from u_test1;

As u_test1:

ns_test=> create table test_06 (id int) tablespace pg_default;
ERROR:  permission denied for tablespace pg_default
ns_test=> create table test_06 (id int);
CREATE TABLE

ns_test=> select relname, reltablespace from pg_class where relname like
'%test_06%';

    relname    | reltablespace
--------------+---------------
  test_06      |             0

ns_test=# select oid,spcname from pg_tablespace;
   oid  |  spcname
-------+------------
   1664 | pg_global
  24585 | ts_test
   1663 | pg_default

------------------

It seems that we not able to revoke create privilege on default tablespace.

I think the main problem is that pg_default has OID=1663, but all objects in
this tablespace have reltablespace=0. Is there reason why 0 is used instead of
correct oid?


        Zdenek

pgsql-bugs by date:

Previous
From: ""
Date:
Subject: BUG #3411: how to add the granted of "Log on as a service"
Next
From: Tom Lane
Date:
Subject: Re: REVOKE CREATE does not work on default tablespace