mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-03-04 13:10:57 +08:00
PG临时主键插入或更新时自增主键不插入
This commit is contained in:
@@ -58,7 +58,7 @@ namespace FreeSql.PostgreSQL.Curd
|
||||
if (IdentityColumn != null && flagInsert) sql = insert.ToSql();
|
||||
else
|
||||
{
|
||||
var ocdu = new OnConflictDoUpdate<T1>(insert.InsertIdentity());
|
||||
var ocdu = new OnConflictDoUpdate<T1>(_tempPrimarys?.Length > 0 ? insert : insert.InsertIdentity());
|
||||
ocdu._tempPrimarys = _tempPrimarys;
|
||||
var cols = _table.Columns.Values.Where(a => _updateSetDict.ContainsKey(a.Attribute.Name) ||
|
||||
_tempPrimarys.Contains(a) == false && a.Attribute.CanUpdate == true && a.Attribute.IsIdentity == false && _updateIgnore.ContainsKey(a.Attribute.Name) == false);
|
||||
|
||||
Reference in New Issue
Block a user