Re: pgsql: Fix partitioned index creation with foreign partitions

Поиск
Список
Период
Сортировка
Искать
От
Amit Langote
Тема
Re: pgsql: Fix partitioned index creation with foreign partitions
Дата
Msg-id
CA+HiwqGV=k_Eh4jBiQw66ivvdG+EUkrEYeHTYL1SvDj_YOYV0g@mail.gmail.com
Ответ на
Список
Дерево обсуждения
pgsql: Fix partitioned index creation with foreign partitions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: pgsql: Fix partitioned index creation with foreign partitions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: pgsql: Fix partitioned index creation with foreign partitions Amit Langote <amitlangote09@gmail.com>
Re: pgsql: Fix partitioned index creation with foreign partitions Alvaro Herrera <alvherre@2ndquadrant.com>
On Thu, Jun 27, 2019 at 8:04 AM Alvaro Herrera  wrote:
>
> On 2019-Jun-26, Alvaro Herrera wrote:
>
> > Fix partitioned index creation with foreign partitions
>
> Hmm, so this causes prion to fail, because -DFORCE_RELCACHE_RELEASE: it
> reports the immediate parent of the would-be-partition rather than the
> topmost ancestor.  I'm not sure I understand why, since relcache release
> shouldn't affect recursion order (maybe that's another bug).  I'll
> investigate more tomorrow.

I see this diff:

 ALTER TABLE lt1 ADD PRIMARY KEY (a);
-ERROR:  cannot create unique index on partitioned table "lt1_part1"
-DETAIL:  Table "lt1_part1" contains partitions that are foreign tables.
+ERROR:  cannot create unique index on partitioned table "ft_part_1_1"
+DETAIL:  Table "ft_part_1_1" contains partitions that are foreign tables.

The table name reported here is that of the foreign table leaf
partition, not of the immediate parent.  Also, what's expected is not
the topmost ancestor, but the immediate parent, which seems OK,
because that's the best that the code in question can manage.

Anyway, the problem seems to use-after-close of a Relation pointer,
which the attached patch fixes.

Thanks,
Amit
В списке pgsql-committers по дате отправления
От: Michael Paquier
Дата:
От: Michael Paquier
Дата:
FAQ