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 60dbf4e34..39a60fa46 100644
--- a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js
+++ b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js
@@ -341,8 +341,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);
       }
     });
