I’m using Psycopg3 (not 2!) and I can’t figure out how can I connect to a remote Postgres server
psycopg.connect(connection_string)
https://www.psycopg.org/psycopg3/docs/
Thanks!
I’m using Psycopg3 (not 2!) and I can’t figure out how can I connect to a remote Postgres server
psycopg.connect(connection_string)
https://www.psycopg.org/psycopg3/docs/
Thanks!
2
Answers
There are two options for connection string according to the documentation
Psycopg3 uses the postgresql connection string which can either be a string of keyword=value elements (separated by spaces)
or a URI
So, put all together with their example (mixed with one example from above connection strings) from their docs: