Skip to content

https://github.com/pgdogdev/pgdog/pull/1568 - #117

Open
jkaczman wants to merge 2 commits into
mainfrom
jk-transaction-now
Open

jkaczman wants to merge 2 commits into
mainfrom
jk-transaction-now

Conversation

@jkaczman

Copy link
Copy Markdown
Contributor

No description provided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 17, 2026

Copy link
Copy Markdown

Deploying pgdog-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fe6e18
Status: ✅  Deploy successful!
Preview URL: https://556fc8b5.pgdog-docs.pages.dev
Branch Preview URL: https://jk-transaction-now.pgdog-docs.pages.dev

View logs

| `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,<br>`rewrite` auto-injects `pgdog.unique_id()` for missing keys,<br>`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"` |
| `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. It also handles re-writing `NOW()` (and other funtions that rely on transaction start time) to be consistent within a transaction. This is especially important when we write such a function to multiple Shards in a singular transaction. 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"` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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. It also handles re-writing `NOW()` (and other funtions that rely on transaction start time) to be consistent within a transaction. This is especially important when we write such a function to multiple Shards in a singular transaction. 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"` |
| `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. It also handles re-writing `NOW()` (and other functions that rely on transaction start time) to be consistent within a transaction. This is especially important when we write such a function to multiple shards in a singular transaction. 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"` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also totally cool to give a short explanation in the table and a longer one somewhere below with examples.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which would you prefer? I'm happy to change it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a short description in the table and expand it below in its own section with examples. It's a really cool feature, it deserves its own section imo

Co-authored-by: Lev Kokotov <levkk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants