pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
REVOKE DROP rights
3+ messages / 2 participants
[nested] [flat]

* REVOKE DROP rights
@ 2019-09-11 16:42  Miles Elam <miles.elam@productops.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Miles Elam @ 2019-09-11 16:42 UTC (permalink / raw)
  To: pgsql-general

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.

Is the only way to put the shared tables into a different schema?

Thanks in advance

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: REVOKE DROP rights
@ 2019-09-11 20:43  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Miles Elam <miles.elam@productops.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2019-09-11 20:43 UTC (permalink / raw)
  To: Miles Elam <miles.elam@productops.com>; +Cc: pgsql-general

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: REVOKE DROP rights
@ 2019-09-11 20:45  Miles Elam <miles.elam@productops.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Miles Elam @ 2019-09-11 20:45 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general

Makes sense. Thanks!

On Wed, Sep 11, 2019 at 1:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> 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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-09-11 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 16:42 REVOKE DROP rights Miles Elam <miles.elam@productops.com>
2019-09-11 20:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-09-11 20:45   ` Miles Elam <miles.elam@productops.com>

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