Re: Restrict user to create only one db with a specific name - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Restrict user to create only one db with a specific name
Date
Msg-id 20200308163059.GA22585@hjp.at
Whole thread Raw
In response to Re: Restrict user to create only one db with a specific name  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On 2020-03-06 16:39:14 -0700, David G. Johnston wrote:
> On Fri, Mar 6, 2020 at 4:28 PM Tiffany Thang <tiffanythang@gmail.com> wrote:
>     Is there a way in PostgreSQL 12 to restrict user to creating a database
>     with a specific database name?
[...]
> Why does userA need create database privileges?

Not speaking for the OP, but:

Some test frameworks (e.g. the one included in Django) like to create
their own test database to ensure that it only contains the test data.
So if you are using one of these as intended the user running the tests
needs to be able to create and drop databases.

If you are running a tests from multiple projects against the same
cluster, it might be a good idea to ensure that each job can only create
(and drop) their own test database and not those of other jobs (or -
worse - the production database).

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: Sándor Daku
Date:
Subject: Re: Another INSTEAD OF TRIGGER question
Next
From: PegoraroF10
Date:
Subject: How to discover what table is