diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-06-29 11:40:36 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-06-29 11:53:22 -0400 |
commit | bc87f22ef6ef1137909ed7363976c67cf1efa7da (patch) | |
tree | f5eb81a3c9247665dbf516379dcb84270ea68fe3 /src | |
parent | 41372071dfaab97a1a8dca83e32b88413460f477 (diff) | |
download | postgresql-bc87f22ef6ef1137909ed7363976c67cf1efa7da.tar.gz postgresql-bc87f22ef6ef1137909ed7363976c67cf1efa7da.zip |
psql: show cloned triggers in partitions
In a partition, row triggers that had been cloned from their parent
partitioned table would not be listed at all in psql's \d, which could
surprise users, per insistent complaint from Ashutosh Bapat (though his
aim was elsewhere). The simplest possible fix, suggested by Peter
Eisentraut, seems to be to list triggers marked as internal if they have
a row in pg_depend that points to some other trigger.
Author: Álvaro Herrera
Discussion: https://postgr.es/m/20180618165910.p26vhk7dpq65ix54@alvherre.pgsql
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/describe.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index e5b3c1ebf9a..6e085158573 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -2713,7 +2713,11 @@ describeOneTableDetails(const char *schemaname, pset.sversion >= 80300 ? "t.tgconstraint <> 0 AS tgisinternal" : "false AS tgisinternal"), oid); - if (pset.sversion >= 90000) + if (pset.sversion >= 110000) + appendPQExpBuffer(&buf, "(NOT t.tgisinternal OR (t.tgisinternal AND t.tgenabled = 'D') \n" + " OR EXISTS (SELECT 1 FROM pg_catalog.pg_depend WHERE objid = t.oid \n" + " AND refclassid = 'pg_catalog.pg_trigger'::regclass))"); + else if (pset.sversion >= 90000) /* display/warn about disabled internal triggers */ appendPQExpBuffer(&buf, "(NOT t.tgisinternal OR (t.tgisinternal AND t.tgenabled = 'D'))"); else if (pset.sversion >= 80300) |