Databases
ConnectAuthQueryResultReplication
Your App10.0.0.5postgres (primary)10.0.0.20:5432WAL + heap files/var/lib/postgresqlHot standby10.0.0.21:5432
Snippet Studio

PostgreSQL · users

CONNpostgresql://app:••••••@localhost:5432/app
Driver psycopg 3
$pip install "psycopg[binary]"
main.py
import psycopg

conn = psycopg.connect(
    host="localhost",
    port=5432,
    user="app",
    password="secret",
    dbname="app",
)
try:
    cur = conn.cursor()

    # Check the server version
    cur.execute("SELECT version()")
    for row in cur.fetchall():
        print(row)

    conn.commit()
finally:
    conn.close()
HowItFlows · the place for visual learners. Message flows are illustrative: sizes and timings are approximate. Review generated code before production use.