Re: Privileges on public schema can't be revoked? - Mailing list pgsql-general

From Tom Lane
Subject Re: Privileges on public schema can't be revoked?
Date
Msg-id 7490.1473185236@sss.pgh.pa.us
Whole thread Raw
In response to Privileges on public schema can't be revoked?  (Greg Fodor <gfodor@gmail.com>)
Responses Re: Privileges on public schema can't be revoked?  (Greg Fodor <gfodor@gmail.com>)
List pgsql-general
Greg Fodor <gfodor@gmail.com> writes:
> Apologies in advance about this since it is likely something obvious,
> but I am seeing some very basic behavior that does not make sense.
> I've tested this on a fresh build of 9.6rc1 and also 9.1.24 (just to
> see if it was a regression.) After creating a test database, and a
> test user that I revoke all privileges on the public schema to, yet
> that user is still able to create tables in the public schema.

You would need to revoke the default grant of privileges to PUBLIC;
revokes against any particular user have no effect on his being
a member of PUBLIC.

IOW, revoke only revokes a previous matching grant, and there was
no such grant in this case.  What there was was a grant to PUBLIC;
see the relevant bit in initdb.c:

        "GRANT CREATE, USAGE ON SCHEMA public TO PUBLIC;\n\n",

            regards, tom lane


pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Privileges on public schema can't be revoked?
Next
From: Naveed Shaikh
Date:
Subject: Re: PostgreSQL Database performance