Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6FdO-0003iW-94 for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jun 2022 18:08:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o6FdM-0005wL-S7 for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jun 2022 18:08:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6FdM-0005wC-KQ for pgsql-bugs@lists.postgresql.org; Tue, 28 Jun 2022 18:08:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6FdK-0006TB-6q for pgsql-bugs@lists.postgresql.org; Tue, 28 Jun 2022 18:08:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 25SI8Giw2700000; Tue, 28 Jun 2022 14:08:16 -0400 From: Tom Lane To: akdmnnakdm@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message In-reply-to: <17534-fcb8fb4c81cd17b6@postgresql.org> References: <17534-fcb8fb4c81cd17b6@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 28 Jun 2022 08:39:21 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2699998.1656439696.1@sss.pgh.pa.us> Date: Tue, 28 Jun 2022 14:08:16 -0400 Message-ID: <2699999.1656439696@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > If some user with createdb privilege would try to create database with > 'tablespace = pg_default' option, query will fail with ERROR: 42501 > But same query without 'tablespace = pg_default' option would work fine, > and new database will be created at pg_default tablespace as expected. I do not think this is a bug. The default tablespace is determined by (copied from) the template database you use, and a user without any tablespace-related privileges shouldn't be able to override that. regards, tom lane