From: Tom Lane <tgl@sss.pgh.pa.us>
To: Miles Elam <miles.elam@productops.com>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: REVOKE DROP rights
Date: Wed, 11 Sep 2019 16:43:32 -0400
Message-ID: <18274.1568234612@sss.pgh.pa.us> (raw)
In-Reply-To: <CAALojA-ZKo-a3kYkYbF-D_+rHGVh08ocpZWgLTrT6iixOc2diQ@mail.gmail.com>
References: <CAALojA-ZKo-a3kYkYbF-D_+rHGVh08ocpZWgLTrT6iixOc2diQ@mail.gmail.com>
Miles Elam <miles.elam@productops.com> writes:
> Is there any way to prevent a user from dropping a table when that user has
> create rights? I'd like to allow that user to be able to create and delete
> their own tables but not specific shared tables.
I think maybe you didn't read the manual closely. Creation privileges
cover the right to create an object (in a given database or
schema), but only the creator/owner has the right to drop a particular
object once it exists.
We do grant the owner of a schema or database the right to drop objects
within it, since they could surely achieve that result by dropping the
whole schema or database. But merely having create privilege doesn't
extend to that.
So basically you want a shared schema that is owned by some trusted
role, and your less-trusted roles have create (and usage!) on that
schema.
regards, tom lane
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, miles.elam@productops.com
Subject: Re: REVOKE DROP rights
In-Reply-To: <18274.1568234612@sss.pgh.pa.us>
References: <CAALojA-ZKo-a3kYkYbF-D_+rHGVh08ocpZWgLTrT6iixOc2diQ@mail.gmail.com> <18274.1568234612@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