key_column_usage and constraint_column_usage were joined on constraint name only, so an N-column foreign key returned N*N column pairs. Read from pg_constraint with unnest(conkey, confkey) instead.
key_column_usage and constraint_column_usage were joined on constraint name only, so an N-column foreign key returned N*N column pairs. Read from pg_constraint with unnest(conkey, confkey) instead.