SSL is not enabled on the server

后端 未结 5 593
走了就别回头了
走了就别回头了 2021-01-30 15:46

Trying to communicate with a postgres database with go, preparing the statement like this:

var stmt *sql.Stmt
var err error

stmt, err = db.Prepare(selectStateme         


        
5条回答
  •  梦谈多话
    2021-01-30 15:55

    This is how I got it working:

    db, err := sql.Open("postgres", "postgres://{user}:{password}@{hostname}:{port}/{database-name}?sslmode=disable")
    

提交回复
热议问题