Closed iynehz closed 2 years ago
In the explanation of PQsetdbLogin, they write:
If the dbName contains an = sign, it is taken as a conninfo string in exactly the same way as if it had been passed to
PQconnectdb, and the remaining parameters are then applied as above.
implying that what you want should be doable by passing everything through the string passed via dbname = at dbConnect().
Thanks! I didn't saw that part of PQsetdbLogin doc. This ticket can be closed.
Now RPostgreSQL uses PQsetdbLogin() https://github.com/tomoakin/RPostgreSQL/blob/85879044a3d4f4b8e9e2da46a971143a8f86c109/RPostgreSQL/src/RS-PostgreSQL.c#L305
But according to pq doc, PQconnectdb() is preferred.
https://www.postgresql.org/docs/8.3/libpq-connect.html
At our workspace we would like to use the krbsrvname connection parameter, and we would avoid the env var approach as it's somewhat dirty. But RPostgreSQL does not directly support the parameter. And studying the matter further makes me think it better to support the PQconnectdb() interface which is a better solution for longer term.