Open Closed

Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone' #2480


User avatar
0
scdev01 created
  • ABP Framework version: v5.1.2
  • UI type: Angular
  • DB provider: EF Core Postgresql
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.
  • Steps to reproduce the issue:"
  • Generate solution from microservice template v5.1.2
  • Switch Db provider to PostgreSQL
  • Regenerate initial migration
  • Run docker containers (db, rabbitmq, ...)
  • Run DbMigrator

1 Answer(s)
  • User Avatar
    0
    sanghel-payoff created

    I'm also encountering major PGSQL compatibility with DateTime entity props, now that Npgsql has been upgraded to 6+.

    I've asked an "official" response to this issue on this support ticket.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-rc.1. Updated on June 18, 2025, 12:26