You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to create Config by parsing empty conn string and getting auth error failed to connect to 'host=localhost user=test database=test_namespace': failed SASL auth (FATAL: password authentication failed for user "test" (SQLSTATE 28P01))
To Reproduce
Steps to reproduce the behavior:
Create Config by parsing empty conn string, fill required params and try to connect to DB
If possible, please provide runnable example such as:
However if I change exactly one line with config parsing cfg, _ := pgxpool.ParseConfig("port=5444 database=test_namespace")
everything works properly
Expected behavior
successful run after soecifying all the params as cfg.ConnConfig.ParamName = ...
Actual behavior failed to connect to 'host=localhost user=test database=test_namespace': failed SASL auth (FATAL: password authentication failed for user "test" (SQLSTATE 28P01))
Version
Go: go1.22.1 windows/amd64
PostgreSQL: PostgreSQL 12.2 (Debian 12.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
pgx: v5.5.5
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
The returned *Config may be modified. However, it is strongly recommended that any configuration that can be done through the connection string be done there. In particular the fields Host, Port, TLSConfig, and Fallbacks can be interdependent (e.g. TLSConfig needs knowledge of the host to validate the server certificate). These fields should not be modified individually. They should all be modified or all left unchanged.
Some types of connection attempts such as multiple hosts (for HA) and the default PGSSLMODE=prefer are implemented via "fallback configs". A fallback config is a different Host, Port, and TLSConfig. This means it tries the connection with first with the base config and then it tries each fallback config and uses its Host, Port, and TLSConfig.
Presumably, the connection config that actually works is one of the fallback configs and that is not changed by updating the top-level Config.Port.
Describe the bug
I'm trying to create Config by parsing empty conn string and getting auth error
failed to connect to 'host=localhost user=test database=test_namespace': failed SASL auth (FATAL: password authentication failed for user "test" (SQLSTATE 28P01))
To Reproduce
Steps to reproduce the behavior:
Create Config by parsing empty conn string, fill required params and try to connect to DB
If possible, please provide runnable example such as:
However if I change exactly one line with config parsing
cfg, _ := pgxpool.ParseConfig("port=5444 database=test_namespace")
everything works properly
Expected behavior
successful run after soecifying all the params as
cfg.ConnConfig.ParamName = ...
Actual behavior
failed to connect to 'host=localhost user=test database=test_namespace': failed SASL auth (FATAL: password authentication failed for user "test" (SQLSTATE 28P01))
Version
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: