PG Bug reporting form <noreply(at)postgresql(dot)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