From f38f32f9f58136bc32dc38f54c107188ed7c299b Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Fri, 27 Jun 2025 13:54:10 +0800 Subject: [PATCH] fix(db): sslmode prefer not supported in some pg version (?) related: #2540 --- inventory/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/client.go b/inventory/client.go index 5242053..bbbee4b 100644 --- a/inventory/client.go +++ b/inventory/client.go @@ -75,7 +75,7 @@ func NewRawEntClient(l logging.Logger, config conf.ConfigProvider) (*ent.Client, client, err = sql.Open("sqlite3", util.RelativePath(dbConfig.DBFile)) case conf.PostgresDB: l.Info("Connect to Postgres database %q.", dbConfig.Host) - client, err = sql.Open("postgres", fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=allow", + client, err = sql.Open("postgres", fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=disable", dbConfig.Host, dbConfig.User, dbConfig.Password,