Re: Getting a error on creating a partition table index 12.2.

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: nikhil raj <nikhilraj474(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Getting a error on creating a partition table index 12.2.
Date: 2020-03-05 19:37:06
Message-ID: 0df4e42e-33e5-bfa5-fe51-5d3a932e2f82@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/5/20 11:31 AM, Alvaro Herrera wrote:
> On 2020-Mar-05, Adrian Klaver wrote:
>
>> On 3/5/20 10:04 AM, nikhil raj wrote:
>
>>> *CREATE INDEX t_e20so1_doi_c_doid_idx
>>>     ON public.t_e20so1_doi USING btree
>>>     (i_doid ASC NULLS LAST)
>>>     TABLESPACE pg_default;*
>
>>> *ERROR: cannot specify default tablespace for partitioned relations SQL
>>> state: 0A00.*
>
>>> Note:- but the same query is executed in the 12.1 version.its working fine.
>>
>> Well this ERROR appeared here:
>>
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;f=src/backend/commands/indexcmds.c;h=87259588d0ab0b8e742e30596afa7ae25caadb18
>
> The reason for the error is the expectation that creating an index on a
> partitioned table with a tablespace specification will cause the
> children indexes (ie. the indexes on the partitions) to use the same
> tablespace.
>
> This does not work properly for the default tablespace, so I made that
> particular condition an error.
>

The OP was wondering why it worked in 12.1 and not 12.2?

I could not see any obvious reason for that, so:

1) There is a not obvious reason

2) It did not work in 12.1 either.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2020-03-05 20:14:32 Re: Getting a error on creating a partition table index 12.2.
Previous Message Alvaro Herrera 2020-03-05 19:31:12 Re: Getting a error on creating a partition table index 12.2.