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.89) (envelope-from ) id 1hYXPa-0007j2-F8 for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 15:01:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYXPZ-0003rK-BW for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 15:01:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYXPY-0003rB-Um for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 15:01:09 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYXPU-0008QS-Qo for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 15:01:07 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 7D35D509C1; Wed, 5 Jun 2019 17:00:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id IUvW3fdsEhwW; Wed, 5 Jun 2019 17:00:39 +0200 (CEST) Message-ID: Subject: Re: granting right to create and delete just one database From: Laurenz Albe To: Chris Withers , pgsql-general@lists.postgresql.org Date: Wed, 05 Jun 2019 17:00:37 +0200 In-Reply-To: <176edf88-10e2-6838-64c0-d9b945367ba4@withers.org> References: <32b82200-576e-d51a-f16c-541068896762@withers.org> <91b121d8f4f2e4a7b85e46f87cf91f634598c88d.camel@cybertec.at> <176edf88-10e2-6838-64c0-d9b945367ba4@withers.org> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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