diff --git a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/Insertable/PostgreSQLInserttable.cs b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/Insertable/PostgreSQLInserttable.cs index 06ddf6d04..7ab8fe771 100644 --- a/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/Insertable/PostgreSQLInserttable.cs +++ b/Src/Asp.Net/SqlSugar/Realization/PostgreSQL/Insertable/PostgreSQLInserttable.cs @@ -13,7 +13,7 @@ namespace SqlSugar { InsertBuilder.IsReturnIdentity = true; PreToSql(); - string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", GetIdentityKeys().FirstOrDefault()); + string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey",this.SqlBuilder.GetTranslationColumnName(GetIdentityKeys().FirstOrDefault())); RestoreMapping(); var result = Ado.GetScalar(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()).ObjToInt(); return result; @@ -22,7 +22,7 @@ namespace SqlSugar { InsertBuilder.IsReturnIdentity = true; PreToSql(); - string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", GetIdentityKeys().FirstOrDefault()); + string sql = InsertBuilder.ToSqlString().Replace("$PrimaryKey", this.SqlBuilder.GetTranslationColumnName(GetIdentityKeys().FirstOrDefault())); RestoreMapping(); var obj = await Ado.GetScalarAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()); var result = obj.ObjToInt();