Re: \d+ fails on index on partition

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: \d+ fails on index on partition
Дата
Msg-id 23037.1538081499@sss.pgh.pa.us
обсуждение исходный текст
Ответ на \d+ fails on index on partition  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Justin Pryzby <pryzby@telsasoft.com> writes:
> pg_get_partition_constraintdef() doesn't like being passed a relkind='I',

It'll also fall over if the passed OID isn't a relation at all, which
is also very much not-nice for SQL-exposed inquiry functions.

I'm inclined to fix this by

(1) inventing an lsyscache function to fetch relispartition, which
will have the behavior of returning false for a lookup failure
(which is generally consistent with the behavior of most of the
other lsyscache functions).

(2) replace the if (rel->rd_rel->relispartition) check in
get_partition_qual_relid with a test like if (get_rel_relispartition(relid)),
and don't open the Relation at all unless that succeeds.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: [PATCH] Improve geometric types
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCH] Improve geometric types