diff --git a/packages/core/destination_writers/postgres_impl.ts b/packages/core/destination_writers/postgres_impl.ts index 9f950fe3b..595a1c69a 100644 --- a/packages/core/destination_writers/postgres_impl.ts +++ b/packages/core/destination_writers/postgres_impl.ts @@ -198,7 +198,8 @@ DO UPDATE SET (${columnsToUpdateStr}) = (${excludedColumnsToUpdateStr})`, const dedupeKey = `${applicationId}__${providerName}__${customerId}__${unifiedData.id}`; const existingLastModifiedAt = dedupeMap.get(dedupeKey); - if (existingLastModifiedAt && existingLastModifiedAt > lastModifiedAt) { + // Some providers have the same lastModifiedAt for multiple records + if (existingLastModifiedAt && existingLastModifiedAt >= lastModifiedAt) { // skip this record, it's older than the existing one return callback(null); } @@ -442,7 +443,8 @@ DO UPDATE SET (${columnsToUpdateStr}) = (${excludedColumnsToUpdateStr})`, const dedupeKey = `${applicationId}__${providerName}__${customerId}__${record.id}__${objectName}`; const existingLastModifiedAt = dedupeMap.get(dedupeKey); - if (existingLastModifiedAt && existingLastModifiedAt > lastModifiedAt) { + // Some providers have the same lastModifiedAt for multiple records + if (existingLastModifiedAt && existingLastModifiedAt >= lastModifiedAt) { // skip this record, it's older than the existing one return callback(null); }