Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9331629

Browse files
committed
psql: have \d show FKs on partitioned tables
Commit3de241d missed to update psql to display foreign keys onpartitioned tables. Add that.Reported-by: Amit LangoteAuthor: Amit LangoteReviewed-by: Álvaro HerreraDiscussion:https://postgr.es/m/a66879e5-636f-d4dd-b4a4-92bdca5a828f@lab.ntt.co.jp
1 parent60e2d9a commit9331629

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/bin/psql/describe.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,8 +2311,13 @@ describeOneTableDetails(const char *schemaname,
23112311
PQclear(result);
23122312
}
23132313

2314-
/* print foreign-key constraints (there are none if no triggers) */
2315-
if (tableinfo.hastriggers)
2314+
/*
2315+
* Print foreign-key constraints (there are none if no triggers,
2316+
* except if the table is partitioned, in which case the triggers
2317+
* appear in the partitions)
2318+
*/
2319+
if (tableinfo.hastriggers||
2320+
tableinfo.relkind==RELKIND_PARTITIONED_TABLE)
23162321
{
23172322
printfPQExpBuffer(&buf,
23182323
"SELECT conname,\n"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp