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
{{ message }}
Repository navigation
PGTARGET_SESSION_ATTRS is ignored, unlike every other option's PG<OPTION_NAME> variable #145
Every option that takes a string, number or boolean is read from PG + its name in upper case (PGSSL, PGIDLE_TIMEOUT, PGPARAMETER_TYPES and so on), except target_session_attrs.
The defaults loop in parseOptions reads PGTARGET_SESSION_ATTRS, but target_session_attrs: tsa(o, url, env) further down the same object literal overwrites it, and tsa() reads only libpq's PGTARGETSESSIONATTRS (src/index.js). So PGTARGET_SESSION_ATTRS=read-write is silently ignored, and the connection goes to any server.
Fix: tsa() also reads PGTARGET_SESSION_ATTRS, with libpq's PGTARGETSESSIONATTRS winning when both are set, and validates whichever value it uses. Add a test that sets only PGTARGET_SESSION_ATTRS.
Once this and #129 (PGMAX read as a string) are fixed, the convention holds for every such option. The environment variable table in docs/api.md (#141 lists one row per option) can then become libpq's names plus a single row for the PG<OPTION_NAME> rule. Accepting libpq's spellings where they differ, such as PGSSLMODE, is #125.
Activity