From f8df4d3d23bdf8c3de91bee82203e3981dd1f422 Mon Sep 17 00:00:00 2001 From: meskill <8974488+meskill@users.noreply.github.com> Date: Wed, 20 May 2026 11:54:00 +0000 Subject: [PATCH 1/2] fix(prepared_statements): fix docs for full --- docs/configuration/pgdog.toml/general.md | 17 ++++++++--------- docs/features/prepared-statements.md | 3 +++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/configuration/pgdog.toml/general.md b/docs/configuration/pgdog.toml/general.md index ac17344a..46dd00ff 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. Useful for drivers like `go/pq`. | +| `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 From e47b62dd6f77121680c2be5e295d0387caf67e74 Mon Sep 17 00:00:00 2001 From: Kiryl Mialeshka <8974488+meskill@users.noreply.github.com> Date: Thu, 21 May 2026 11:54:37 +0200 Subject: [PATCH 2/2] Update docs/configuration/pgdog.toml/general.md Co-authored-by: Lev Kokotov --- docs/configuration/pgdog.toml/general.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/pgdog.toml/general.md b/docs/configuration/pgdog.toml/general.md index 46dd00ff..a8ddaf04 100644 --- a/docs/configuration/pgdog.toml/general.md +++ b/docs/configuration/pgdog.toml/general.md @@ -371,7 +371,7 @@ Controls which prepared statement protocols PgDog rewrites for its global cache. |---|---|---|---|---| | `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. Useful for drivers like `go/pq`. | +| `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`**