<!-- Source: @site/projects/sqlens-for-laravel/docs/drivers/pgsql.md -->
<!-- Canonical: https://docs.pushery.com/sqlens-for-laravel/drivers/pgsql/ -->

# PostgreSQL driver

> What the PostgreSQL driver reads, the version floor it assumes, and the engine facts its rules are built on.

- **Connection driver:** `pgsql`
- **Minimum server version:** PostgreSQL 18

The `pgsql` driver is what a PostgreSQL connection resolves to. It supplies the rules that judge a
migration's SQL on this engine, the readers that answer questions about the live catalog, and the
canonicalization that turns whatever the query builder emitted into one comparable form.

## The version floor is a floor, not a target

Below PostgreSQL 18 the driver does not resolve, and the run reports
[`version_below_floor`](https://docs.pushery.com/sqlens-for-laravel/drivers/unsupported.md#version-below-floor) rather than checking anything. That is a
deliberate refusal: the rules describe behavior older releases do not have, and applying them anyway
would produce confident, wrong advice — the failure mode this package is built to avoid.

Above the floor, a rule that only applies to a version range says so through its own version window.
The engine evaluates that window *before* the rule runs, so a rule can never fire outside the
versions it was written for, and an unknown version produces a named `undetermined` finding instead
of a silent pass.

## What the driver never does

It opens no transaction of its own, takes no lock, and writes nothing. Every rule reads a subject
the capture layer already produced, and the catalog readers use catalog and statistics views only.
A run against a production replica is safe by construction rather than by convention.

## Related

- [Understanding `undetermined`](https://docs.pushery.com/sqlens-for-laravel/understanding-undetermined.md) — why a check that could not run says so
- [Canonical form](https://docs.pushery.com/sqlens-for-laravel/canonical-form.md) — what the rules actually see
- [Rules](https://docs.pushery.com/sqlens-for-laravel/rules.md) — the catalog, including every `PG.*` rule
