diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js index 44ffca5e0..eaf7de600 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js +++ b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js @@ -342,8 +342,8 @@ export default class ERDCore { tableData.foreign_key?.forEach((theFkRow)=>{ let theFk = theFkRow.columns[0]; let attnum = _.find(tableNode.getColumns(), (col)=>col.name==theFk.local_column).attnum; - /* Skip all those whose attnum matches to the link */ - if(linkData.local_column_attnum != attnum) { + /* Skip all those whose attnum and table matches to the link */ + if(linkData.local_column_attnum != attnum || linkData.referenced_table_uid != theFk.references) { newForeingKeys.push(theFkRow); } });