Skip to content

Introduce support of Postgres 19 to the Spock (temporary decision)#518

Open
danolivo wants to merge 4 commits into
mainfrom
spoc-610
Open

Introduce support of Postgres 19 to the Spock (temporary decision)#518
danolivo wants to merge 4 commits into
mainfrom
spoc-610

Conversation

@danolivo

@danolivo danolivo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@danolivo danolivo self-assigned this Jul 3, 2026
@danolivo danolivo added the enhancement New feature or request label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds PostgreSQL 19 support across CI workflows, documentation, Docker build logic, compatibility shims, and version-gated C code paths.

Changes

PostgreSQL 19 support

Layer / File(s) Summary
Workflow and documentation updates
.github/workflows/installcheck.yml, .github/workflows/nightly_tap.yml, .github/workflows/pg-stable-test.yml, .github/workflows/random-delays-regress.yml, .github/workflows/spockbench.yml, .github/workflows/zodan_sync.yml, README.md, docs/getting_started.md, docs/index.md, docs/spock_release_notes.md
CI matrices and user-facing docs are extended to include PostgreSQL 19, and the release notes add a PG19 support highlight.
Docker PG ref resolution
tests/docker/Dockerfile-step-1.el9
The Docker build script switches PG19 builds to REL_${PGVER}_STABLE while keeping tag discovery for earlier versions.
Compatibility shims and includes
src/compat/19/spock_compat.c, src/compat/19/spock_compat.h, include/spock_jsonb_utils.h, include/spock_output_plugin.h, src/spock.c, src/spock_apply.c, src/spock_output.c, src/spock_progress_recovery.c
A new PG19 compatibility header is added, related includes and guards are updated, and existing C files include the compatibility shim header.
Commit timestamp and JSON output
src/spock_output_plugin.c, src/spock_proto_json.c, src/spock_proto_native.c
Commit timestamp access is routed through SpockTxnCommitTime(txn) in native and JSON output, and the composite JSON helper is renamed.
PG19 runtime API changes
src/spock_conflict_stat.c, src/spock_functions.c, src/spock_readonly.c, src/spock_relcache.c, src/spock_manager.c
Subscription statistics, DDL replication, recovery conflict handling, delta lookup calls, and database-name header inclusion are updated for PostgreSQL 19 API changes.

Poem

A rabbit hops where PG19 blooms,
Through workflows, docs, and code it zooms. 🐇
Stable refs and shims align,
Cluster, repack, and commits shine.
Carrots for the tests stack high—
The burrow’s ready for the PG19 sky.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided, so the PR text is too vague to assess meaningfully. Add a brief description of the main code and workflow changes so reviewers can understand the PR's purpose.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding PostgreSQL 19 support to Spock.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spoc-610

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Jul 3, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/getting_started.md`:
- Line 78: The PostgreSQL version substitution guidance is too vague because the
examples still hard-code 18 in multiple places. Update the getting started text
to explicitly say users must replace all version-specific references together,
and point readers to the relevant example identifiers such as the package names,
paths, and the postgresql-18 service name so they know every occurrence must be
changed consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 68bdea0f-59ee-456f-96f7-0568d18d7535

📥 Commits

Reviewing files that changed from the base of the PR and between cf8421f and 2099853.

📒 Files selected for processing (17)
  • .github/workflows/installcheck.yml
  • .github/workflows/nightly_tap.yml
  • .github/workflows/pg-stable-test.yml
  • .github/workflows/random-delays-regress.yml
  • .github/workflows/spockbench.yml
  • .github/workflows/zodan_sync.yml
  • README.md
  • docs/getting_started.md
  • docs/index.md
  • docs/spock_release_notes.md
  • src/spock_conflict_stat.c
  • src/spock_functions.c
  • src/spock_output.c
  • src/spock_progress_recovery.c
  • src/spock_proto_native.c
  • src/spock_readonly.c
  • tests/docker/Dockerfile-step-1.el9

Comment thread docs/getting_started.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/spock_proto_native.c (1)

1028-1028: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Type change is functionally a no-op; prefer bits16 for API-alignment clarity.

bits16 is a typedef of uint16, so this compiles fine either way, but core's format_type_extended() declares its flags parameter as bits16. Keeping the local variable typed as bits16 better documents intent and matches the core API it's passed into.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/spock_proto_native.c` at line 1028, The local flags variable in the
formatting path is using uint16 even though it is passed into
format_type_extended(), whose flags parameter is bits16. Update the declaration
in this area to use bits16 instead, keeping the existing value and behavior
unchanged, so the type matches the core API and the intent is clearer.
src/spock_proto_json.c (1)

221-221: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider documenting the rename rationale.

Unlike the other PG19 shims in this PR (spock.c, spock_output_plugin.h, spock_jsonb_utils.h), this rename has no comment explaining why. Core PostgreSQL exposed a global composite_to_json() (exported for COPY TO ... FORMAT json), which would otherwise clash with this file's static function on PG19+. A short comment would prevent a future accidental revert.

📝 Suggested comment
-static void spock_composite_to_json(Datum composite, StringInfo result,
+/* Renamed from composite_to_json to avoid clashing with the symbol
+ * PostgreSQL core exports for COPY TO ... FORMAT json support. */
+static void spock_composite_to_json(Datum composite, StringInfo result,
 									bool use_line_feeds);

Also applies to: 569-569

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/spock_proto_json.c` at line 221, Add a brief explanatory comment near
spock_composite_to_json stating that the rename is intentional on PG19+ to avoid
clashing with PostgreSQL’s exported global composite_to_json() used by COPY TO
... FORMAT json. Update the surrounding shim comment in this area so future
readers understand why this static name differs from the other PG19
compatibility shims and won’t accidentally revert it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/spock_proto_json.c`:
- Line 221: Add a brief explanatory comment near spock_composite_to_json stating
that the rename is intentional on PG19+ to avoid clashing with PostgreSQL’s
exported global composite_to_json() used by COPY TO ... FORMAT json. Update the
surrounding shim comment in this area so future readers understand why this
static name differs from the other PG19 compatibility shims and won’t
accidentally revert it.

In `@src/spock_proto_native.c`:
- Line 1028: The local flags variable in the formatting path is using uint16
even though it is passed into format_type_extended(), whose flags parameter is
bits16. Update the declaration in this area to use bits16 instead, keeping the
existing value and behavior unchanged, so the type matches the core API and the
intent is clearer.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc5647ec-e431-4d98-955a-3370fc043380

📥 Commits

Reviewing files that changed from the base of the PR and between 328948e and 4e24e89.

📒 Files selected for processing (9)
  • include/spock_jsonb_utils.h
  • include/spock_output_plugin.h
  • src/compat/19/spock_compat.h
  • src/spock.c
  • src/spock_apply.c
  • src/spock_output_plugin.c
  • src/spock_proto_json.c
  • src/spock_proto_native.c
  • src/spock_relcache.c
✅ Files skipped from review due to trivial changes (1)
  • src/spock_apply.c
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/compat/19/spock_compat.h

@danolivo danolivo force-pushed the spoc-610 branch 3 times, most recently from fb72116 to 391be09 Compare July 3, 2026 12:47
danolivo and others added 4 commits July 3, 2026 15:55
Version shims for PG19: RepOriginId->ReplOriginId, the replorigin session
globals folded into replorigin_xact_state, index_beginscan flags argument,
ShmemInitHash losing max_size, AssertVariableIsOfType->StaticAssertVariableIsOfType,
and isQueryUsingTempRelation->query_uses_temp_object.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Guard or redirect the call sites affected by PG19: the exposed
server_message_level_options/composite_to_json, the flattened
ReorderBufferTXN xact_time, JsonbInState, RepackStmt (was ClusterStmt),
SignalRecoveryConflictWithVirtualXID, pgstat_fetch_entry/get_database_name
relocations, and the wait_event.h include dropped from pgstat.h.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add pg19 to the workflow matrices.  PG19 has no GA tag yet, so the Docker
build temporarily tracks the tip of REL_19_STABLE instead of a tag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
List 19 as supported, note the version-substitution caveat in getting
started, and add a 6.0.0 release-note highlight.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant