Re: BUG #18167: cannot create partitioned tables when default_tablespace is set

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: mariusraicu(at)laposte(dot)net, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18167: cannot create partitioned tables when default_tablespace is set
Date: 2023-10-25 07:45:44
Message-ID: 202310250745.x6mzvzbsk4bz@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2023-Oct-24, PG Bug reporting form wrote:

> marius(at)[local]:5434/postgres=# show default_tablespace;
> default_tablespace
> --------------------
> tblspc1
> (1 row)
>
> marius(at)[local]:5434/postgres=# create tablespace tblspc1 location
> '/home/marius/pgcode/tblspc1';
> CREATE TABLESPACE
> marius(at)[local]:5434/postgres=# create database test tablespace tblspc1;
> CREATE DATABASE
> marius(at)[local]:5434/postgres=# \c test
> You are now connected to database "test" as user "marius".
> marius(at)[local]:5434/test=# create table toto(id numeric) partition by
> list(id);
> ERROR: cannot specify default tablespace for partitioned relations

Oh, so the problem here is that *both* default_tablespace and the
database's tablespace are set, and then a partitioned table creation
fails when it doesn't specify any tablespace? That indeed sounds like a
bug. I'll have a look, thanks. I'm surprised it took so long for this
to be reported.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Someone said that it is at least an order of magnitude more work to do
production software than a prototype. I think he is wrong by at least
an order of magnitude." (Brian Kernighan)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2023-10-25 08:16:22 Re: AW: AW: BUG #18147: ERROR: invalid perminfoindex 0 in RTE with relid xxxxx
Previous Message Boyer, Maxime (he/him | il/lui) 2023-10-24 19:44:19 RE: BUG #18168: Parallel worker failed to initialize: could not create inherited socket: error code 10106

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2023-10-25 07:45:53 Re: Bug: RLS policy FOR SELECT is used to check new rows
Previous Message Richard Guo 2023-10-25 07:23:28 Re: Simplify create_merge_append_path a bit for clarity