Restrict user to create only one db with a specific name

From: Tiffany Thang <tiffanythang(at)gmail(dot)com>
To: Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Restrict user to create only one db with a specific name
Date: 2020-03-06 23:28:08
Message-ID: CAB_W-NNf3RUDHOMPOvYhyTTdrbYE5pEQp72f9GZLJSB13f--7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
Is there a way in PostgreSQL 12 to restrict user to creating a database
with a specific database name?

For example, userA can only create a database with a name called mydb. Any
other names would generate an error.

If that is not possible, will it be possible then to limit userA to
creating only one database? Granting the createdb privilege would allow the
user to create any number of databases which I want to avoid.

Thanks.

Tiff

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2020-03-06 23:39:14 Re: Restrict user to create only one db with a specific name
Previous Message Dmitry Igrishin 2020-03-06 19:40:42 Re: libpq and escaping array string literals