On this page
Any PostgreSQL client works — PLOMID speaks PG Frontend/Backend v3 natively. No plugins.
flowchart TB
subgraph App["your application"]
DRV["PG driver\n(psycopg / pg / JDBC)"]
POOL["your connection pool"]
DRV --- POOL
end
App -->|"postgresql://user:pass@host:5432/db"| SRV["plomid-server\nport 5432"]
SRV --> ENG["engine: SQL → MVCC → storage"]
ENG --> DISK["./data\nWAL + checkpoints"]Diagram source · mermaidcopy included
flowchart TB
subgraph App["your application"]
DRV["PG driver\n(psycopg / pg / JDBC)"]
POOL["your connection pool"]
DRV --- POOL
end
App -->|"postgresql://user:pass@host:5432/db"| SRV["plomid-server\nport 5432"]
SRV --> ENG["engine: SQL → MVCC → storage"]
ENG --> DISK["./data\nWAL + checkpoints"]Python (psycopg)#
import psycopg
conn = psycopg.connect("postgresql://plomid:[email protected]:5432/plomid", autocommit=True)
with conn.cursor() as cur:
cur.execute("SELECT id, name FROM users WHERE id = %s", (1,))
print(cur.fetchall())
# transaction:
with conn.transaction():
with conn.cursor() as cur:
cur.execute("INSERT INTO orders VALUES (%s, %s, %s, now())", (201, 1, 19.99))Node (pg)#
import { Client } from "pg";
const c = new Client({ connectionString: "postgresql://plomid:[email protected]:5432/plomid" });
await c.connect();
await c.query("BEGIN");
await c.query("INSERT INTO users VALUES ($1, $2)", [10, "grace"]);
await c.query("COMMIT");
await c.end();Extended protocol (Parse/Bind/Describe/Execute/Sync, $1 params, WITH ORDINALITY table funcs, generate_series) is implemented in crates/network/src/server/handler.rs. Batchable INSERT … VALUES without RETURNING/ON CONFLICT is staged across Executes and flushed as one implicit transaction at Sync.
Sessions and errors#
- Session params:
server_version 17.0,client_encoding UTF8,DateStyle ISO MDY,TimeZone UTC,search_path "$user",public. SQLSTATEs map to PG codes (28P01auth,08P01protocol). - On error in extended mode the connection enters
InFailedTransactionuntilSync. pg_catalog+information_schemaexpose live catalog rows for tool introspection (see pg_catalog).
Checklist#
- Use parameterized queries; never interpolate.
- Keep transactions short; handle
Conflictby retrying the whole transaction. - Handle empty results (zero rows) distinctly from NULL.
- Pool at the app layer; server limit is
max_connections=100000with graceful reject.
Next: Transactions · Errors
Was this page helpful? Thanks — noted locally, nothing is sent anywhere.