I'm trying to connect to a Postgres cluster using the DSN in atlas.hcl. Note how this contains multiple host entries, which is possible according to the libpq documentation
Error: postgres: scanning system variables: pq: unrecognized configuration parameter "target_session_attrs"
Whereas target_session_attrs is important to determine the primary server in a cluster which allows / is suitable for read-write operations; rather then accidentally connecting to a replication node.
Additional information
The same string works without a hitch with github.com/jackc/pgx/v5 e.g. the listing below yields <nil> indicating that a successful connection could be made with a DSN containing multiple hosts. We also use pgx in conjunction with ent and that works perfectly fine.
Problem
I'm trying to connect to a Postgres cluster using the DSN in
atlas.hcl
. Note how this contains multiple host entries, which is possible according to the libpq documentationHowever, I get this error message when I run e.g.
atlas migrate apply --env myenvironment
.Additionally, this will fail too:
With this error:
Whereas
target_session_attrs
is important to determine the primary server in a cluster which allows / is suitable for read-write operations; rather then accidentally connecting to a replication node.Additional information
The same string works without a hitch with
github.com/jackc/pgx/v5
e.g. the listing below yields<nil>
indicating that a successful connection could be made with a DSN containing multiple hosts. We also usepgx
in conjunction withent
and that works perfectly fine.