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
обсуждение исходный текст
Ответ на Re: pgsql: Fix partitioned index creation with foreign partitions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: pgsql: Fix partitioned index creation with foreign partitions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-committers
On Thu, Jun 27, 2019 at 8:04 AM Alvaro Herrera <alvherre@2ndquadrant.com> 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
Дата:
Сообщение: pgsql: Remove remaining traces of Rand_OpenSSL() from the tree
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pgsql: Drop test user when done with it.