diff --git a/flow/connectors/postgres/client.go b/flow/connectors/postgres/client.go index 304e313f4c..9bd55380c7 100644 --- a/flow/connectors/postgres/client.go +++ b/flow/connectors/postgres/client.go @@ -683,7 +683,7 @@ func (c *PostgresConnector) generateMergeStatement( } if slices.Contains(normalizedTableSchema.PrimaryKeyColumns, columnName) { primaryKeyColumnCasts[columnName] = fmt.Sprintf("(_peerdb_data->>'%s')::%s", columnName, pgType) - primaryKeySelectSQLArray = append(primaryKeySelectSQLArray, fmt.Sprintf("src.%s=dst.%s", + primaryKeySelectSQLArray = append(primaryKeySelectSQLArray, fmt.Sprintf(`src."%s"=dst."%s"`, columnName, columnName)) } }