diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
index 92fc3fa4f..26d7065af 100644
--- a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
+++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
@@ -530,6 +530,7 @@ export class ResultSetUtils {
       'not_null': c.not_null,
       'has_default_val': c.has_default_val,
       'is_array': arrayBracketIdx > -1 && arrayBracketIdx + 2 == columnTypeInternal.length,
+      'is_pk': isPK,
     };
   }
 
@@ -1248,6 +1249,11 @@ export function ResultSet() {
     let row = newRows[otherInfo.indexes[0]];
     let clientPK = rowKeyGetter(row);
 
+    // Check if column is pk and value is null set it to default value.
+    if(otherInfo.column.is_pk && _.isNull(row[otherInfo.column.key])) {
+      row[otherInfo.column.key] = undefined;
+    }
+
     if(clientPK in (dataChangeStore.added || {})) {
       /* No need to track this */
     } else if(clientPK in (dataChangeStore.updated || {})) {
