\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
Re: \d doesn't show partitioned table foreign keys |
| Список | 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 по дате отправления: