Re: CREATE TABLE in PUBLIC schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heni Lolov <hal_bg(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CREATE TABLE in PUBLIC schema
Date: 2002-11-13 17:47:22
Message-ID: 23647.1037209642@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Heni Lolov <hal_bg(at)yahoo(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Hugh Esco 2002-11-13 19:07:24 Troubles at Startup
Previous Message Warren Massengill 2002-11-13 16:54:36 7.3b download problem