From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Restrict user to create only one db with a specific name
Date: Sun, 8 Mar 2020 17:30:59 +0100
Message-ID: <20200308163059.GA22585@hjp.at> (raw)
In-Reply-To: <CAKFQuwb4yvm0LvEh=eAgF-gARucRC16fo9vPdDx0E9AbL=U1gA@mail.gmail.com>
References: <CAB_W-NNf3RUDHOMPOvYhyTTdrbYE5pEQp72f9GZLJSB13f--7Q@mail.gmail.com>
<CAKFQuwb4yvm0LvEh=eAgF-gARucRC16fo9vPdDx0E9AbL=U1gA@mail.gmail.com>
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!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: hjp-pgsql@hjp.at
Subject: Re: Restrict user to create only one db with a specific name
In-Reply-To: <20200308163059.GA22585@hjp.at>
References: <CAB_W-NNf3RUDHOMPOvYhyTTdrbYE5pEQp72f9GZLJSB13f--7Q@mail.gmail.com> <CAKFQuwb4yvm0LvEh=eAgF-gARucRC16fo9vPdDx0E9AbL=U1gA@mail.gmail.com> <20200308163059.GA22585@hjp.at>
* 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