修复PostgreSQL首次安装连接选项与配置迁移不一致

This commit is contained in:
xuans committed 2026-09-21 01:23:54 +08:00
1 parent b8a4801533
commit d4282f654b
4 files changed
+67 -3

No files matched your search

+2 -1
View File
@@ -363,7 +363,8 @@ func buildPostgresDSN(settings DatabaseSettings, previousDSN string) (string, er
query = previous.Query()
}
if query.Get("sslmode") == "" {
query.Set("sslmode", "disable")
// 首次安装与正式运行保持相同的 TLS 要求,避免完成安装时切换连接语义。
query.Set("sslmode", "require")
}
parsed := &url.URL{
Scheme: "postgres",