I'm using LLBLGen Pro 5.4 with Npgsql 3.2.7. I've come across what I believe is a bug with PostgreSQL date arithmetic. It seems like it's almost identical to this issue posted a few years ago:
https://llblgen.com/tinyforum/Messages.aspx?ThreadID=22961
This C# code...
var memberAuditReadiness = new MemberAuditReadinessInfo
{
IsActive = LLBLGenUtils.db.User
.Any(u => u.MemberId == memberId && u.LastLoginDateUtc.HasValue && u.LastLoginDateUtc.Value.AddMonths(MemberAuditReadinessConsts.MonsSinceLastLoginForActiveMembers) > DateTime.UtcNow)
};
...is being turned into this query...
SELECT CASE WHEN EXISTS (SELECT "LPLA_1"."usetwofactorauthentication" AS "UseTwoFactorAuthentication" FROM "public"."User" "LPLA_1" WHERE ( ( ( ( "LPLA_1"."memberid" = $1) AND ( "LPLA_1"."lastlogindateutc" IS NOT NULL)) AND ( CAST(("LPLA_1"."lastlogindateutc" + interval ':p5 month') AS date) > $2)))) THEN 1 ELSE 0 END AS "LPFA_2" FROM "public"."User" "LPLA_1" LIMIT 1
...which is resulting in this error:
invalid input syntax for type interval: ":p5 month" at character 273