Skip to content

Commit b1f7b3e

Browse files
committed
When comparing trigger columns, do not rely on tgattr
1 parent 5b9b184 commit b1f7b3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

check_postgres.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,11 @@ package check_postgres;
13511351
n1.nspname AS tschema, c1.relname AS tname,
13521352
n2.nspname AS cschema, c2.relname AS cname,
13531353
n3.nspname AS procschema, p.proname AS procname,
1354-
pg_get_triggerdef(t.oid) AS triggerdef
1354+
pg_get_triggerdef(t.oid) AS triggerdef,
1355+
( WITH nums AS (SELECT unnest(tgattr) AS poz)
1356+
SELECT string_agg(attname,',') FROM pg_attribute a JOIN nums ON
1357+
(nums.poz = a.attnum AND tgrelid = a.attrelid)
1358+
) AS trigger_columns
13551359
FROM pg_trigger t
13561360
JOIN pg_class c1 ON (c1.oid = t.tgrelid)
13571361
JOIN pg_roles r ON (r.oid = c1.relowner)
@@ -7070,7 +7074,7 @@ sub check_same_schema {
70707074
[index => 'relpages,reltuples,indpred,indclass,
70717075
indexprs,indcheckxmin,reltablespace,
70727076
indkey', '' ],
7073-
[trigger => 'tgqual,tgconstraint', '' ],
7077+
[trigger => 'tgqual,tgconstraint,tgattr', '' ],
70747078
[constraint => 'conbin,conindid,conkey,confkey,
70757079
confmatchtype', '' ],
70767080
[column => 'atttypid,attnum,attbyval,attndims', '' ],

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy