Re: CREATE TABLE in PUBLIC schema - Mailing list pgsql-admin

From Tom Lane
Subject Re: CREATE TABLE in PUBLIC schema
Date
Msg-id 23647.1037209642@sss.pgh.pa.us
Whole thread Raw
In response to Re: CREATE TABLE in PUBLIC schema  (Heni Lolov <hal_bg@yahoo.com>)
List pgsql-admin
Heni Lolov <hal_bg@yahoo.com> writes:
> ive tried :
> revoke all ON schema public from hal;
> but does not work. Why?

You'd need to revoke the permissions from PUBLIC; they were never granted
specifically to hal, thus the above revoke is a no-op.

Don't forget to revoke CREATE at the database level, too, else a user
can just create his own schema.  Perhaps also revoke TEMP, depending on
whether you'd like to forbid temporary tables as well.

In short, something like

revoke create on schema public from public;
revoke create,temp on database mydb from public;

should give you a database in which users can't create anything.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Warren Massengill"
Date:
Subject: 7.3b download problem
Next
From: Hugh Esco
Date:
Subject: Troubles at Startup