如果使用的是PostgreSql17版本的,Navcat需要使用最新版本Navcat17,否则连接会出现 Method10 不支持的错误
连接字符串如下
User ID=postgres;Password=Sf660328+;Host=localhost;Port=5432;Database=hcf.test.dev;Pooling=true;
EFCore CodeFirst生成的数据库 如果C#下是DateTime类型,则数据库会生成timestamp类型,如果直接通过插入DateTime类型会报错,需要在程序启动前添加两行代码
//添加以下两行代码
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
//程序启动
AppHost.UseStartup<Startup>().Run();