BUG #18709: Explicit tablespace pg_default not working when creating of indices in partitioned tables - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18709: Explicit tablespace pg_default not working when creating of indices in partitioned tables
Date
Msg-id 18709-cd75136db7addf69@postgresql.org
Whole thread Raw
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18709
Logged by:          Ondřej Navrátil
Email address:      onavratil@monetplus.cz
PostgreSQL version: 14.13
Operating system:   Linux
Description:

Long story short, lets have a partitioned table:
```
create table test_table (
  id integer,
  description text
) partition BY range(id);
```
...and create some tablespace. Now this works nicely:
```
create index descri_index on test_table (description) tablespace
my_custom_tablespace;
```
..but for some reason, the same returns an error when pg_default is
explicitly requested as a tablespace
```
create index descri_index2 on test_table (description) tablespace
pg_default;
```
psql:commands.sql:9: ERROR:  cannot specify default tablespace for
partitioned relations

In some versions, same applies to `create table ... partitioned by` - using
a custom tablespace works, but explicitly denoting pg_default as the target
yields an error.


pgsql-bugs by date:

Previous
From: Greg Sabino Mullane
Date:
Subject: Re: Export PostgreSQL database into mysql database
Next
From: Tom Lane
Date:
Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"