From 8d7af970b4a9311a8a36343f1faf3e1a34f733ac Mon Sep 17 00:00:00 2001 From: jkaczman Date: Tue, 15 Sep 2026 19:15:54 -0400 Subject: [PATCH 1/2] Docs for https://github.com/pgdogdev/pgdog/pull/1541 --- docs/configuration/pgdog.toml/rewrite.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/configuration/pgdog.toml/rewrite.md b/docs/configuration/pgdog.toml/rewrite.md index 3fc89359..7b1ea3d3 100644 --- a/docs/configuration/pgdog.toml/rewrite.md +++ b/docs/configuration/pgdog.toml/rewrite.md @@ -13,6 +13,7 @@ The `rewrite` section controls PgDog's automatic SQL rewrites for sharded databa shard_key = "error" split_inserts = "error" primary_key = "ignore" + omni_non_deterministic_functions = "ignore" ``` === "Helm chart" ```yaml @@ -21,6 +22,7 @@ The `rewrite` section controls PgDog's automatic SQL rewrites for sharded databa shardKey: "error" splitInserts: "error" primaryKey: "ignore" + omniNonDeterministicFUnctions: "ignore" ``` | Setting | Description | Default | @@ -29,6 +31,7 @@ The `rewrite` section controls PgDog's automatic SQL rewrites for sharded databa | `shard_key` | Behavior when an `UPDATE` changes a sharding key: `error` rejects the statement,
`rewrite` migrates the row between shards,
`ignore` forwards it unchanged. | `"error"` | | `split_inserts` | Behavior when a sharded table receives a multi-row `INSERT`: `error` rejects the statement, `rewrite` fans the rows out to their shards, `ignore` forwards it unchanged. | `"error"` | | `primary_key` | Behavior when an `INSERT` is missing a `BIGINT` primary key: `error` rejects the statement,
`rewrite` auto-injects `pgdog.unique_id()` for missing keys,
`ignore` allows the INSERT without modification. | `"ignore"` | +| `omni_non_deterministic_functions` | Behavior when an `INSERT` is headed to an omnisharded table using a function (such as date-time functions) that will not be consistent when performing the functions separately on each shard. Thus, it re-writes all such functions before performing the `INSERT` with constant values to maintain consistency. Example: `NOW()` is re-written to `2026-09-15 18:14:09.123456-05` (or whatever the current time is) before performing the individual `INSERT` operations. This applies to both `DEFAULT` table schema and functions called within a VALUES list of an `INSERT`. `ignore` allows the `INSERT` without modification. | `"ignore"` | !!! note "Two-phase commit" Consider enabling [two-phase commit](../../features/sharding/2pc/index.md) when either feature is set to `rewrite`. Without it, rewrites are committed shard-by-shard and can leave partial changes if a transaction fails. @@ -41,6 +44,7 @@ The admin database exposes these toggles via the `SET` command: SET rewrite_enabled TO true; -- enable/disable rewrite engine SET rewrite_shard_key_updates TO rewrite; -- error | rewrite | ignore SET rewrite_split_inserts TO rewrite; -- error | rewrite | ignore +SET rewrite_omni_non_deterministic_functions TO rewrite; -- error | rewrite | ignore ``` The setting changes are applied immediately. These overrides allow canary testing before persisting them in `pgdog.toml`. From 870699728ea54ed12c58a766ffa3b1452c671001 Mon Sep 17 00:00:00 2001 From: jkaczman Date: Tue, 15 Sep 2026 19:54:45 -0400 Subject: [PATCH 2/2] Helm typo --- docs/configuration/pgdog.toml/rewrite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/pgdog.toml/rewrite.md b/docs/configuration/pgdog.toml/rewrite.md index 7b1ea3d3..45352c76 100644 --- a/docs/configuration/pgdog.toml/rewrite.md +++ b/docs/configuration/pgdog.toml/rewrite.md @@ -22,7 +22,7 @@ The `rewrite` section controls PgDog's automatic SQL rewrites for sharded databa shardKey: "error" splitInserts: "error" primaryKey: "ignore" - omniNonDeterministicFUnctions: "ignore" + omniNonDeterministicFunctions: "ignore" ``` | Setting | Description | Default |