\d doesn't show partitioned table foreign keys

Поиск
Список
Период
Сортировка
От Amit Langote
Тема \d doesn't show partitioned table foreign keys
Дата
Msg-id a66879e5-636f-d4dd-b4a4-92bdca5a828f@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: \d doesn't show partitioned table foreign keys  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Re: \d doesn't show partitioned table foreign keys  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi.

I just noticed $subject, which attached seems to fix, although not sure if
that's the correct fix for the issue.

create table foo (a int primary key);
create table doo (a int primary key);
create table bar (a int references foo references doo) partition by list (a);
create table bar1 partition of bar for values in (1);

\d bar
                Table "public.bar"
 Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------
 a      | integer |           |          |
Partition key: LIST (a)
Number of partitions: 1 (Use \d+ to list them.)

But can see the key on the partition.

\d bar1
                Table "public.bar1"
 Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------
 a      | integer |           |          |
Partition of: bar FOR VALUES IN (1)
Foreign-key constraints:
    "bar_a_fkey" FOREIGN KEY (a) REFERENCES foo(a)
    "bar_a_fkey1" FOREIGN KEY (a) REFERENCES doo(a)

After applying the patch:

\d bar
                Table "public.bar"
 Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------
 a      | integer |           |          |
Partition key: LIST (a)
Foreign-key constraints:
    "bar_a_fkey" FOREIGN KEY (a) REFERENCES foo(a)
    "bar_a_fkey1" FOREIGN KEY (a) REFERENCES doo(a)
Number of partitions: 1 (Use \d+ to list them.)

Will add this to open items.

Thanks,
Amit

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Surjective functional indexes
Следующее
От: Amit Langote
Дата:
Сообщение: Re: \d doesn't show partitioned table foreign keys