I would like to connect to postgresql database by R using connecting string.
So far I used the standard method, where I separately define the user, password, server, etc.
However, attempts to connect using the connecting string end in failure.
When I use:
dbConnect(
RPostgres::Postgres(),
host = "test_server_address",
port = 12345,
dbname = "test_db_name",
user = "test_user",
password = "test_password"
)
It works fine, connection has been established, but when I use:
dbConnect(RPostgres::Postgres(), .connection_string = "Uid=test_user;Pwd=test_password;Host=test_server_address;Port=12345;Database=test_db_name;")
I get error: Error: invalid connection option ".connection_string"
How to repair code which contain connection string to make it works?