pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron Johnson <ron.l.johnson@cox.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Ability to create tables
Date: Fri, 09 Mar 2018 18:46:15 -0500
Message-ID: <27665.1520639175@sss.pgh.pa.us> (raw)
In-Reply-To: <2b6740bf-cab4-6ddf-2928-665d632efb41@cox.net>
References: <2b6740bf-cab4-6ddf-2928-665d632efb41@cox.net>

Ron Johnson <ron.l.johnson@cox.net> writes:
> Even though I revoked the  CREATE priv on role ABCREADONLY, it's still able 
> to create tables.  What can I do to prevent this?

> $ psql -c 'revoke create on database "ABC123" from "ABCREADONLY";'

That revokes the ability to create new schemas within that database
(which I suspect the role did not have anyway).  What you need is
to remove its ability to create objects within the public schema
within that database.  By default, that ability is granted to PUBLIC,
so that "revoke create on schema public from "ABCREADONLY";" won't
help either.  What you have to do is "revoke create on schema public
from public", and then grant it back to just the roles that should have
it.

If you don't want the role creating temp tables either, you need to
revoke its TEMP right on the database (which *is* a database-level
privilege).  Again, this'll involve disallowing that to PUBLIC,
since that default grant is how it's getting the privilege.

			regards, tom lane




view thread (3+ messages)  latest in thread

Message-ID: <27665.1520639175@sss.pgh.pa.us>
Permalink:  ../27665.1520639175@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27665.1520639175@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ron.l.johnson@cox.net
  Subject: Re: Ability to create tables
  In-Reply-To: <27665.1520639175@sss.pgh.pa.us>
  References: <2b6740bf-cab4-6ddf-2928-665d632efb41@cox.net> <27665.1520639175@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox