//! The PostgreSQL version floor and the one query that checks it (ADR 0041).
//!
//! Runs at exactly two entry points — [`crate::PostgresOutboxStore::connect`] and the first
//! statement of [`crate::migrate`] — never per pooled connection and never on any hot path: the
//! floor is a property of the server, so it cannot change under a live connection in a way a
//! per-statement check would ever catch first.
use PgExecutor;
/// The floor this crate enforces, in PostgreSQL's own `server_version_num` encoding (`major *
/// 10_000 + minor`) — `180_000` for PostgreSQL 18.0. **Public** so a host can state the same
/// requirement in its own preflight without hard-coding the number (ADR 0041). There is no
/// older-version fallback: a server below this reports
/// [`crate::PostgresStoreError::UnsupportedServerVersion`] or
/// [`crate::MigrateError::UnsupportedServerVersion`], never a degraded mode.
pub const MIN_SERVER_VERSION_NUM: u32 = 180_000;
/// Reads the connected server's `server_version_num` via `current_setting` — the integer form
/// PostgreSQL itself uses for version comparisons. Chosen over parsing `SHOW server_version` (or
/// the driver's own cached startup value) because it needs no string parsing and survives a
/// beta/RC version string a text parse would mishandle (ADR 0041).
pub async