diff --git a/docs/configuration/pgdog.toml/general.md b/docs/configuration/pgdog.toml/general.md index ac17344a..a8ddaf04 100644 --- a/docs/configuration/pgdog.toml/general.md +++ b/docs/configuration/pgdog.toml/general.md @@ -365,15 +365,14 @@ Default: **`disabled`** ### `prepared_statements` -Enables support for prepared statements. Available options are: - -- `disabled` -- `extended` -- `extended_anonymous` -- `full` - -`full` enables support for rewriting prepared statements sent over the simple protocol. `extended` handles prepared statements sent normally -using the extended protocol. `extended_anonymous` caches and rewrites unnamed prepared statements, which is useful for some legacy client drivers. +Controls which prepared statement protocols PgDog rewrites for its global cache. + +| Setting | Extended named | Extended anonymous | Simple `PREPARE`/`EXECUTE` | Notes | +|---|---|---|---|---| +| `disabled` | no | no | no | Statements are forwarded as-is with no rewriting. | +| `extended` | yes | no | no | Default. Rewrites named extended-protocol statements (`Parse`/`Bind`/`Execute`). | +| `extended_anonymous` | yes | yes | no | Also rewrites unnamed (anonymous) extended-protocol statements. | +| `full` | yes | no | yes | Superset of `extended`. Also rewrites simple-protocol `PREPARE`/`EXECUTE`. Requires parsing every query; higher CPU cost. | Default: **`extended`** diff --git a/docs/features/prepared-statements.md b/docs/features/prepared-statements.md index 24c9a426..a164d203 100644 --- a/docs/features/prepared-statements.md +++ b/docs/features/prepared-statements.md @@ -72,6 +72,9 @@ PREPARE __pgdog_1 AS SELECT * FROM users; Statements sent over the simple protocol are not checked against the global cache. Each new statement is given a unique global name. Since this requires PgDog to parse _each_ incoming query, and that's computationally expensive, this feature is **disabled** by default. +!!! note + `full` extends `extended`: it rewrites named extended-protocol statements in addition to simple-protocol `PREPARE`/`EXECUTE`. + You can enable it in [`pgdog.toml`](../configuration/pgdog.toml/general.md#prepared_statements): ```toml