psycopg_pool.AsyncConnectionPool.
Every pool the kit builds proves its first connection before it is handed out, and that
proof is the one place a connection’s establishment is retried (retry_attempts, with
the kit’s exponential backoff and a WARNING per retried failure). A statement is never
re-run.
EXPLICIT_DSN_POOL_MAX_SIZE
tai42_kit.clients.impl.postgres.EXPLICIT_DSN_POOL_MAX_SIZE
EXPLICIT_DSN_POOL_MIN_SIZE
tai42_kit.clients.impl.postgres.EXPLICIT_DSN_POOL_MIN_SIZE
PostgresClient
tai42_kit.clients.impl.postgres.PostgresClient
psycopg_pool.AsyncConnectionPool, one pool per DSN per loop.
The pool is named <owner>@<host>/<db>; min_size/max_size and
retry_attempts (re-attempts of the first connection’s establishment) are this
database’s deployment settings read when the pool is built; a second settings
prefix resolving to the same DSN with different values raises. Compose
PostgresConnectionSettings for the connection kwargs.
open_dedicated_pool
tai42_kit.clients.impl.postgres.open_dedicated_pool
role, its first connection proven and its fill awaited.
A settings object supplies the DSN, the deployment’s pool sizes and its
pg_retry_attempts; a DSN string gets EXPLICIT_DSN_POOL_MIN_SIZE /
EXPLICIT_DSN_POOL_MAX_SIZE and the behaviour of options (the caller’s own
namespace; omitted means a single attempt). options with a settings object raises
TypeError: the settings carry their own. The pool is named
postgres@<host>/<db>:<role>; connection_kwargs apply to every connection it opens.
The caller owns the pool and closes it.
Parameters
pinned_connection
tai42_kit.clients.impl.postgres.pinned_connection
min_size == max_size == 1) built outside the shared
cache, named <owner>@<host>/<db>:pinned, opened through the same probe (with the
settings’ pg_retry_attempts) and bounded fill as the pooled path. The caller
holds exactly one connection, so a session-scoped advisory lock taken on it covers
every statement in the body, and a driver error on it never touches the shared pool. The pool and its connection
close on any exit — normal return, exception, or cancellation.
Parameters
postgres_pool_name
tai42_kit.clients.impl.postgres.postgres_pool_name
name for a database pool: <owner>@<host>/<db>.
Host and database come from the DSN via conninfo_to_dict — never the user
or password, which must not reach a pool name that surfaces in log lines. A
non-empty role appends a :<role> suffix so a dedicated pool (a pinned
connection, a langgraph store/checkpoint pool) is distinguishable in the logs.
Parameters
read_connection
tai42_kit.clients.impl.postgres.read_connection
pool.connection() inside
conn.transaction(). The pool must be a PostgresClient pool, whose reset
callback returns the connection to transactional mode when it comes back.
Parameters

