+ We strongly recommend using connection pooling to connect to your database because it's + compatible with both IPv4 and IPv6 networks. You'll only need to change the connection + credentials that you're using in your application to the pooler's connection credentials. +
+ }> + + Learn more + + ++ If you are not connecting to the database from serverless environments, we strongly + recommend you connect to the database directly instead of using connection pooling for + lower latency. +
++ Since your project has the IPv4 add on, you are not required to use the connection pooler + even if your network only supports IPv4. +
+ }> + + Learn more + + ++ You need to set your Pool Mode to{' '} + Transaction in the{' '} + Connection pooling configuration section below in + order to use transaction mode on port 6543. +
++ Otherwise, port 6543 will continue to connect in{' '} + Session mode. +
++ How to connect to a different database or switch to another user +
++ You can use the following URI format to switch to a different database or user + {snap.usePoolerConnection ? ' when using connection pooling' : ''}. +
+
+ {poolerConnStringSyntax.map((x, idx) => {
+ if (x.tooltip) {
+ return (
+
+ Connecting to SQL Alchemy +
+
+ Please use postgresql:// instead of postgres:// as
+ your dialect when connecting via SQLAlchemy.
+
+ Example:
+ create_engine("postgresql+psycopg2://...")
+
+ To use transaction mode, change the pool mode in the{' '} + {isDatabaseSettingsPage ? ( + { + const el = document.getElementById('connection-pooler') + if (el) { + setOpen(false) + el.scrollIntoView({ + behavior: 'smooth', + block: 'center', + }) + } + }} + > + pooling configuration settings + + ) : ( + + pooling configuration settings + + )}{' '} + to use transaction mode first. +
++ You can then connect to session mode on port 5432 and + transaction mode on port 6543. +
+