Skip to content
github-actions[bot] edited this page Apr 1, 2026 · 41 revisions

plex-postgresql Wiki

Run Plex Media Server with PostgreSQL instead of SQLite. Zero Plex modifications required.

Latest release: v1.3.1

Rust-safe shim runtime. 92% of unsafe raw pointer dereferences eliminated. Business logic is Rust-safe; unsafe confined to FFI boundary.

  • 92% unsafe reduction — raw pointer dereferences 806→59, internal functions use safe &mut references
  • Memory leak fix — 1.8GB→59MB footprint (PGresult leak, transaction routing, cached_result cleanup)
  • 3 deadlocks eliminated — recursive conn mutex, ABBA prevention, convoy fix
  • 11 data races fixed — atomic counters, seqlocks, OnceLock, eager hook resolution
  • PgStmt Vec-based — on-demand allocation, 540 bytes for 0-param queries (was 88KB)
  • Rust Mutex on PgStmtpthread_mutex_t replaced with std::sync::Mutex
  • 138 functions de-FFI'd — enables inlining, eliminates C ABI overhead
  • Clippy clean — zero warnings with -D warnings on Linux CI
  • Duplicate stmt fix: SQLSTATE 42P05 detection, DEALLOCATE ALL at connection init (v0.9.40)
  • Stale stmt recovery: prepared statement cache auto-invalidated after PG restart via SQLSTATE 26000 (v0.9.39)
  • Pool auto-grow: pool automatically grows when threads exceed configured size (v0.9.36)
  • Single-row streaming mode for all READ queries (PQsetSingleRowMode) (v0.9.28)

Pages

Clone this wiki locally