Unable to connect to multiple host in postgres : missing = after “host1,” in connection info string

  Kiến thức lập trình

I want to make connection in postgres with this dsn format:
user=username password=password host=host1, host2, host3 port=5432 database=db_aob sslmode=prefer target_session_attrs=read-write

but i got error “missing “=” after “host1,” in connection info string”

i try to remove space between host, but i got error “dial tcp: lookup host1,host2,host3: no such host”

is my dsn format wrong?

i connect with package database/sql in golang

New contributor

chirzul maula is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.