Psycopg: 20 years of mostly friendly coexistence with libpq
summary
Psycopg is a libpq wrapper that keeps encountering concrete gaps: pipeline mode exists at the wire level since 2003 but lands in libpq in 2021 and takes months of redesign to integrate successfully; logical replication forces low‑level parsing and keep‑alive heuristics that clients must reimplement, so a PG output decoder in libpq would cut repeated work; asynchronous connections require redoing multi‑host timeouts, service parsing and DNS ordering in Python; GSSAPI causes distro segfaults so psycopg3 disables it by default; OAuth device flow was easier to reimplement in ~60 Python lines than accept 3,000 C lines.
AI-written summary · about
