pub async fn check_postgres_server_available(
args: &PostgresArgs,
) -> Result<(), TargetError>Expand description
Probes a PostgreSQL server for connectivity and verifies the configured table is readable.
Used by both the admin validation flow (pre-flight before persisting a
target) and PostgresTarget::init() (runtime startup check). The probe is
strictly read-only:
- Build a deadpool pool from
args(cheap, no actual connection yet). - Check out a single connection.
- Run
SELECT 1to confirm the credentials work. - Run
SELECT 1 FROM <schema>.<table> LIMIT 0to confirm the relation exists and the user has read permission.LIMIT 0ensures no rows are actually returned and no DML side effects occur.
The whole flow is wrapped in an 8s tokio::time::timeout so a stuck DNS
resolver or TLS handshake cannot exhaust the admin layer’s outer 10s
timeout.