diff --git a/Src/Asp.Net/PgSqlTest/UnitTest/UnitTestReturnPkList.cs b/Src/Asp.Net/PgSqlTest/UnitTest/UnitTestReturnPkList.cs index cb21ed2de..d5417731d 100644 --- a/Src/Asp.Net/PgSqlTest/UnitTest/UnitTestReturnPkList.cs +++ b/Src/Asp.Net/PgSqlTest/UnitTest/UnitTestReturnPkList.cs @@ -47,6 +47,14 @@ namespace OrmTest var ids2 = db.Insertable(new List() { new UnitIdentity01() { Name = "c" }, new UnitIdentity01() { Name = "c" } }).ExecuteReturnPkList(); if (ids2.Count(z => z > 0) != 2) { throw new Exception("unit error"); } if (db.Queryable().In(ids2).Count() != 2) { throw new Exception("unit error"); } + var list = new List(); + for (int i = 0; i < 1000; i++) + { + list.Add(new UnitIdentity01() { Name = "a" }); + } + var ids3 = db.Insertable(list).ExecuteReturnPkList(); + if (db.Queryable().In(ids3).Count() != 1000) { throw new Exception("unit error"); } + db.DbMaintenance.TruncateTable(); } public class UnitGuid123 diff --git a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs index bdd43340d..287ef2370 100644 --- a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs @@ -56,6 +56,10 @@ namespace SqlSugar StringBuilder batchInsetrSql = new StringBuilder(); int pageSize = 200; int pageIndex = 1; + if (IsNoPage&&IsReturnPkList) + { + pageSize = groupList.Count; + } int totalRecord = groupList.Count; int pageCount = (totalRecord + pageSize - 1) / pageSize; while (pageCount >= pageIndex)