SQLAlchemy + Postgres Cheatsheet 10 — Upsert, RETURNING, and COPY
Cheatsheet: ON CONFLICT DO UPDATE / DO NOTHING, RETURNING, bulk insert via execute(insert(), list), asyncpg COPY.
Cheatsheet: ON CONFLICT DO UPDATE / DO NOTHING, RETURNING, bulk insert via execute(insert(), list), asyncpg COPY.
Streaming replication, read replica routing, failover handling in SQLAlchemy, and using pgvector for embeddings.
Cheatsheet: declarative partitioning, partition creation, query pruning, pg_partman automation.
Cheatsheet: vector column, HNSW vs IVFFlat, cosine / L2 / inner-product distance, RAG hybrid filter.
Cheatsheet: per-tenant schemas, search_path, multi-schema Alembic env, onboarding.
Cheatsheet: pg_dump options, pg_basebackup, pgBackRest, WAL archiving, RPO/RTO planning, restore tests.
Cheatsheet: per-tenant engine cache, connection routing, multi-DB Alembic, onboarding.
Cheatsheet: Vector column, cosine_distance / l2 / inner_product, HNSW index, hybrid filter + ANN.
Cheatsheet: streaming vs logical replication, Patroni, multi-host failover URLs, read replicas.
Cheatsheet: VACUUM variants, ANALYZE for stats, REINDEX for bloat, autovacuum tuning.