pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message
2+ messages / 2 participants
[nested] [flat]

* BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message
@ 2022-06-28 08:39 PG Bug reporting form <noreply@postgresql.org>
  2022-06-28 18:08 ` Re: BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2022-06-28 08:39 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: akdmnnakdm@gmail.com

The following bug has been logged on the website:

Bug reference:      17534
Logged by:          Nick Nalbantov
Email address:      akdmnnakdm@gmail.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-speci...),
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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message
  2022-06-28 08:39 BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message PG Bug reporting form <noreply@postgresql.org>
@ 2022-06-28 18:08 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2022-06-28 18:08 UTC (permalink / raw)
  To: akdmnnakdm@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> 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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-06-28 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 08:39 BUG #17534: 'tablespace' option crushes 'create database' query with 'permission denied' message PG Bug reporting form <noreply@postgresql.org>
2022-06-28 18:08 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox