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
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