BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: akdmnnakdm(at)gmail(dot)com
Subject: BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message
Date: 2022-06-28 08:39:21
Message-ID: 17534-fcb8fb4c81cd17b6@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17534
Logged by: Nick Nalbantov
Email address: akdmnnakdm(at)gmail(dot)com
PostgreSQL version: 14.4
Operating system: Windows
Description:

Here's an old problem (look at
https://dba.stackexchange.com/questions/204807/why-do-i-get-a-postgresql-permission-error-when-specifying-a-tablespace-in-the?rq=1),
but it's still reproducible in PG 15b1 on Windows and PG13 on Debian 10

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.

Steps to reproduce:

psql -U postgres -d postgres
create role test with login password '123' createdb;
\q

psql -U test -d postgres
\set VERBOSITY verbose
CREATE DATABASE test
OWNER = test
ENCODING = UTF8
TABLESPACE = pg_default; -- query works as expected if this line is
missing

ERROR: 42501: permission denied for tablespace pg_default
LOCATION: aclcheck_error, aclchk.c:3652

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Johansen 2022-06-28 17:24:23 Re: Auto-vacuum timing out and preventing connections
Previous Message Michael Paquier 2022-06-28 07:58:49 Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end