Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/drivers/pgsql: Connection fails when password is empty #3899

Closed
wlynxg opened this issue Oct 29, 2024 · 0 comments · Fixed by #3900
Closed

contrib/drivers/pgsql: Connection fails when password is empty #3899

wlynxg opened this issue Oct 29, 2024 · 0 comments · Fixed by #3900
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@wlynxg
Copy link
Contributor

wlynxg commented Oct 29, 2024

Go version

go version go1.22.4 windows/amd64

GoFrame version

v2.7.4

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

package main

import (
	pg "github.com/gogf/gf/contrib/drivers/pgsql/v2"
	"github.com/gogf/gf/v2/database/gdb"
)

func main() {
	d := &pg.Driver{}
	db, err := d.Open(&gdb.ConfigNode{
		Host: "192.168.0.1",
		Port: "5432",
		Pass: "test",
		Type: "pgsql",
		User: "postgres",
		Name: "test",
	})
	if err != nil {
		panic(err)
	}

	err = db.Ping()
	if err != nil {
		panic(err)
	}
}

What did you see happen?

panic: dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

What did you expect to see?

No error

@wlynxg wlynxg added the bug It is confirmed a bug, but don't worry, we'll handle it. label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant