Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jAypc-0002Jt-05 for pgsql-general@arkaria.postgresql.org; Sun, 08 Mar 2020 16:31:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jAypZ-0005ax-L2 for pgsql-general@arkaria.postgresql.org; Sun, 08 Mar 2020 16:31:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jAypZ-0005aq-Aq for pgsql-general@lists.postgresql.org; Sun, 08 Mar 2020 16:31:09 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAypR-0001ml-VH for pgsql-general@lists.postgresql.org; Sun, 08 Mar 2020 16:31:08 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id A1876274F; Sun, 8 Mar 2020 17:30:59 +0100 (CET) Date: Sun, 8 Mar 2020 17:30:59 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Restrict user to create only one db with a specific name Message-ID: <20200308163059.GA22585@hjp.at> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-03-06 16:39:14 -0700, David G. Johnston wrote: > On Fri, Mar 6, 2020 at 4:28 PM Tiffany Thang wro= te: > Is there a way in PostgreSQL 12 to restrict user to creating a databa= se > 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 --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --azLHFNyN32YCQGCU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl5lHb4ACgkQ8g5IURL+ KF3Eyg//SAi6CpERtUIWN38wCYAK168RgMAu8wegBaO+93yGAt9vnAybltblW0S/ 1w9mzq9P3rtPlpgMZ/8qa/JsZRB5sA67RlKkoh+LXbOp5Soh3y4o7bOEECY6NWUe WdrNim0zBnalDvUE88Qyf2+TcwyKQrfPdFfvYHxSqcFAbqP9Tocy1vB781hPhGq+ o/lpTFi6qo83wrB14IX67NEA77Kq5prEDhuRtccVxOEGZXOhW+d6xaiChAoTsPK2 ocbvBsQBLIE8lgD0z/wg4Faq39fNtfr+COJIKA0h2guYowDhfORcktvNfkzgnjQm C9AOaG/OGFoM/FzhU7aSWS1qlROa91H4VAY2gF7zKrMlINB8jTsbP7sITi6fqxBZ jWIEj8C6mAsBVo5vCt5JdPw1onidy8LduMCvT45b+7Ft/If0OluJMwJdOJXkhJjh loToMi3J79EJdAyI6e/NowaS4ZVN1fCeLUUXaq/yFfh1V+oDi7HgPRrW48Td09Yz +lseCuFL8cWIT3Y4i+8I4E/8cd5KorN1KFzBL+6WqMr2bOHOJAJ5bYHtGFpkH1HV nDTCIc+wV1BJ1zzo2ujtEZv1JAePkqZ7T07CJ96xG7b+W1XMJvqGGailQTfIqjH4 6YSmSCeFBn3981rjFfyNM3Av+rucGVWAaqSqARWkqvrPiozt0D0= =PnL7 -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--