psycopg2 connection with multihosts I have 3 db servers on docker containers, and i used to connect like this from my python app:
psycopg2.connect(host="db-0", user="user", password="password", database="data") This works,but if i add more then 1 host it fails.

psycopg2.connect(host="db-0, db-1", user="user", password="password", database="data")
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name "db-0, db-1" to address: Temporary failure in name resolution


my package is:

psycopg2-2.8.4 

python3.7

psql 11.5 on docker containers db-0 and db-1
I used pip install psycopg2 to install.
Specify a single libpq style connection string:

psycopg2.connect("host=db-0,db-1 user=user password=password dbname=data")