Re: granting right to create and delete just one database

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Chris Withers <chris(at)withers(dot)org>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: granting right to create and delete just one database
Date: 2019-06-05 15:00:37
Message-ID: d6e35f82ffbb0129462aed594ee6286bf28c0125.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Withers wrote:
> > > Is there any way to grant rights to a user such that they can drop and
> > > re-create only a single database?
> > No; what I'd do if I needed that is to create a SECURITY DEFINER function
> > that is owned by a user with the CREATEDB privilege.
>
> Thanks, that's a great idea! Is this pattern documented anywhere as a
> complete finished thing?

I'm afraid that is left as an exercise to the reader.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message guyren 2019-06-05 15:08:04 Advice on setting cost for function
Previous Message Magnus Hagander 2019-06-05 14:49:51 Re: verify checksums / CREATE DATABASE