On fre, 2011-12-02 at 17:11 +0100, Yeb Havinga wrote:
> Using a cast, it is possible to create a table with a code path through
> OpenIntoRel:
>
> session 1:
> t=# revoke all on type int2 from public;
> session2 :
> t=> create table t2 (a int2);
> ERROR: permission denied for type smallint
> t=> create table t as (select 1::int2 as a);
> SELECT 1
> t=> \d t
> Table "public.t"
> Column | Type | Modifiers
> --------+----------+-----------
> a | smallint |
>
> t=>
>
> Something different: as non superuser I get this error when restricting
> a type I don't own:
>
> t=> revoke all on type int2 from public;
> ERROR: unrecognized objkind: 6
Two excellent finds. Here is an updated patch with fixes.