summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/psql/describe.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 410131e5c72..e5b3c1ebf9a 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2311,8 +2311,13 @@ describeOneTableDetails(const char *schemaname,
PQclear(result);
}
- /* print foreign-key constraints (there are none if no triggers) */
- if (tableinfo.hastriggers)
+ /*
+ * Print foreign-key constraints (there are none if no triggers,
+ * except if the table is partitioned, in which case the triggers
+ * appear in the partitions)
+ */
+ if (tableinfo.hastriggers ||
+ tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
printfPQExpBuffer(&buf,
"SELECT conname,\n"