diff --git a/Src/Asp.Net/SqlSugar/Abstract/Reportable/ReportableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/Reportable/ReportableProvider.cs index ff96cad18..393f137b6 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/Reportable/ReportableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/Reportable/ReportableProvider.cs @@ -200,6 +200,10 @@ namespace SqlSugar { return $" CAST( NULL AS DATETIME) "; } + else if (entityColumnInfo != null && entityColumnInfo.UnderType == UtilConstants.DateType && value == null && this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL) + { + return $" CAST( NULL AS timestamp) "; + } if (value == null) return "null"; var type =UtilMethods.GetUnderType(value.GetType());