Re: comparing output of internal pg tables of referenced tables

2019-09-19 Thread Tom Lane
Mariel Cherkassky writes: > 2)select conname, (select r.relname from pg_class r where r.oid = > c.confrelid) as orig_table,(select array_agg(attname) from pg_attribute >where attrelid = c.confrelid and ARRAY[attnum] <@ c.conkey) as > orig_cols, (select r.relname from pg_class r where r.o

comparing output of internal pg tables of referenced tables

2019-09-19 Thread Mariel Cherkassky
Hey, I tried to get a list of all tables that has a reference to my_table. I used two different queries : 1)select R.* from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE u inner join INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS FK on U.CONSTRAINT_CATALOG = FK.UNIQUE_CONSTRAINT_CATALOG and U.CON