Skip to content

PostgreSQL 19 RC 1: replace SQL/PGQ with relational one-hop joins and move the engine image - #530

Merged
fazpu merged 7 commits into
mainfrom
chore/postgres-19-rc1
Nov 6, 2026
Merged

fazpu merged 7 commits into
mainfrom
chore/postgres-19-rc1

Conversation

@fazpu

@fazpu fazpu commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

UMC relaunch plan phase 2 item (g): move the engine's Postgres image from 19beta3 to PostgreSQL 19 RC 1. PostgreSQL 19 Beta 4 reverted SQL/PGQ, so this PR also replaces every SQL/PGQ use with plain relational SQL (orchestrator decision, 2026-11-06). The D98 live graph stays; only its query mechanism changes.

Commit 1: image move (unchanged from the original #530)

  • Dockerfile.postgres: postgres:19rc1-trixie@sha256:f6bab6213c486e940e310a88490935cbc71b88f6c19fee3cd2ab14b3b02ff65b (multi-arch). pg_textsearch 1.5.1 builds with -include limits.h (upstream error: use of undeclared identifier INT_MAX timescale/pg_textsearch#586), so there is no source patch. pgvector 0.8.6-1.pgdg13+2, pg_partman 5.5.0.
  • compose.yaml, release.yml (remember-stack-postgres:19rc1-<version>), RELEASING.md. Compose builds Dockerfile.postgres locally until the next release publishes the RC 1 image.

Commit 2: SQL/PGQ replaced with relational SQL

  • One-hop read (postgres_graph_sql.py): CURRENT_/HISTORY_NEIGHBORHOOD_ONE_HOP replace the two GRAPH_TABLE statements. Each is a static join over the existing edge views rememberstack_graph_internal.relations_current / relations_history, the views the property graph's relates edge table pointed at. It has one UNION ALL branch per edge direction and drops self-loops. It runs after the unchanged relational budget guard. Both endpoints of every edge row are already live entity vertices, so no vertex join is needed.
  • Evidence-gate fence. The D140 gate sits above an OFFSET 0, the same fence the guard uses. Without it the planner pushed the gate into the edge view and ran it on every relation of the deployment. On a store with accumulated test data that exceeded the graph role's 5 s timeout. The old PGQ statement on Beta 3 has the same failure: origin/main's test_sql_pgq_neighborhood_is_live_and_paginates times out on such a store. A new plan test pins the fence.
  • Removed: both property graphs, GRANT ... ON PROPERTY GRAPH, and the property-graph catalog/ACL checks (information_schema.pg_*, pg_get_propgraphdef, pg_property_graph_privileges). The catalog check now verifies that the node and edge views exist, plus helpers, citation traversal and roles as before.
    • ops graph-catalog ensure JSON drops definitions.
    • Readiness reasons are renamed: graph_pgq_guard_smoke_failed becomes graph_one_hop_guard_smoke_failed, and graph_pgq_smoke_failed becomes graph_one_hop_smoke_failed. Docs are updated to match.
  • Migrations.
    • Shipped p9_17_0038, p9_38_0059 and p9_40_0061 (and the shared fact_graph_contract rebuild) no longer create or grant the property graphs. Their drops use a guarded DROP_PROPERTY_GRAPHS helper, which runs DROP PROPERTY GRAPH via EXECUTE only for relkind = 'g' rows. Only a Beta 3 store can have those rows, so RC 1 never parses the statement.
    • This edits shipped migrations. It is the only way a fresh install can run on RC 1, because the old DDL is a syntax error there. D98 also keeps pre-GA storage disposable and replayable. A Beta 3 store at any intermediate revision still upgrades: the guarded drop runs wherever the old code dropped the graph.
    • New p9_44_0065 drops the graphs from Beta 3 stores already at the prior head. On RC 1 it does nothing. Its downgrade is a no-op.
  • Docs. decisions.md gets a D98 RC 1 amendment: the graph stays, the query mechanism changes, and the superseded clauses are marked inside D98. The following are reconciled: p2_graph_design.md, postgres_schema_design.md, open_query_space_design.md, overall_design.md, the analysis (a dated section on alternatives) and the plans. Website pages are updated: requirements, upgrades (the Beta 3 to RC 1 path), install, choose, operating, architecture, and ingest reason codes. llms-full.txt is regenerated.
  • Round-1 Codex minors fixed:
    • The pgvector 0.8.7 availability wording.
    • Docs no longer call 19rc1-0.17.2 published.
    • "beta" wording is updated.

Upgrade path for an existing Beta 3 database

RC 1 changes the catalog version, and pg_upgrade/pg_restore would replay the property-graph DDL. The order is:

  1. Upgrade the engine on Beta 3, so p9_44_0065 drops the graphs.
  2. Move the data to RC 1.

Verification

  • Parity on one Beta 3 database seeded by origin/main's graph fixture: the old *_PGQ and new *_ONE_HOP statements return identical rows. That covers 1218 statement pairs and 540 rows: 29 anchors × every predicate filter × 3 instants × current/history.
  • Beta 3 upgrade.
    • Store at p9_41 with both property graphs and data, run with this branch's code: alembic upgrade head gives p9_44_0065, 0 relkind 'g', and pg_dump contains no PROPERTY GRAPH. (Before the upgrade the dump had 2.)
    • Then pg_dumpall --roles-only + pg_dump -Fc on Beta 3, restored into an empty RC 1 server with pg_restore --exit-on-error: clean. upgrade head is a no-op, graph_catalog_problems() == (), and the one-hop statements run (60 rows).
    • pg_upgrade was not tested.
  • New test test_fresh_setup_runs_on_a_server_without_sql_pgq: on the CI image the server rejects CREATE PROPERTY GRAPH, a fresh install reaches head, no property graph exists, and the catalog check passes. The Compose quickstart job also runs setup and live-graph readiness on the RC 1 image built from Dockerfile.postgres.
  • Local RC 1 (arm64): test_postgres_graph_sql, test_graph_queries, test_pipeline_readiness, test_ops_cli, test_query_sandbox_batch_b, test_query_sandbox_graph_d98, test_d140_migration, and the graph-related test_migrations cases all pass.
    • One run had a transient truncated in test_recursive_helper_null_depth_uses_default_and_truthful_data_status, which uses a 1 s time budget on a loaded machine. That test touches no changed code, and it passed on rerun.
  • ruff check, ruff format, pyright (0 errors); generate_docs_llms.py --check; check_docs_truth.py; check_release_contract.py.
  • Full CI (amd64) on 3ffd7c6 (rebased after feat(ledger): claim leases and a reaper for dead workers (D145) #529; migration renumbered to p9_44_0065)
  • Codex round 2: REQUEST_CHANGES (1 major, 2 minor), all fixed in 722566a (see comment)
  • Codex round 3: REQUEST_CHANGES (2 majors: main-checkout quickstarts need --build; generated TS metadata), fixed in 79d34f5/82e9504e7
  • Codex round 4: APPROVE on 82e9504

Commit 3: CI

  • The compatibility matrix runs released engines 0.15.0/0.16.0 against the PostgreSQL image they shipped with (remember-stack-postgres:19beta3-<version>, via POSTGRES_IMAGE in .github/ci/start-postgres.sh). Their migrations create property graphs that RC 1 cannot parse. The candidate still runs on this branch's RC 1 image.
  • TypeScript contract sourceHash refreshed.

Coordination: rebased on main; the migration chains after #529's p9_43_0064_claim_leases.

Contributor agreement

🤖 Generated with Claude Code

https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm

@fazpu

fazpu commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Codex review round 1 (gpt-6.1-sol, max effort)

VERDICT: REQUEST_CHANGES

  1. Blocker — RC 1 removes the SQL/PGQ support required to start the engine. Dockerfile.postgres:78 selects a server that rejects CREATE PROPERTY GRAPH, executed by migration p9_17_0038:1280. I reproduced this on arm64; amd64 contract CI reports the same failure. Fresh setup cannot complete. PostgreSQL explicitly removed SQL/PGQ in Beta 4. Simplest fix: retain the working Beta 3 foundation and mark this plan item blocked by that removal.

  2. Minor — the pgvector availability claim is incorrect. docker/README.md:17 says no newer build exists, but PGDG publishes postgresql-19-pgvector 0.8.7-1.pgdg13+1 for both architectures in its archive. Simplest fix: remove or qualify that sentence; changing the tested pin is unnecessary.

  3. Minor — docs call an unpublished image published. requirements/page.mdx:38 lists 19rc1-0.17.2 as published; registry inspection returns manifest unknown. Simplest fix: describe the local-build fallback until publication. The Compose/release coordinates themselves satisfy the release contract.

  4. Minor — current-state beta descriptions remain. install/page.mdx:91 and choose/page.cloud.mdx:33 still describe the runtime as beta. Simplest fix if retaining the RC change: use “prerelease” and regenerate llms-full.txt.

Verification otherwise passed: exact Docker Hub digest/platforms, PGDG pins, header compatibility checks, fresh GCC/LLVM compilation with -include limits.h, all 82 pg_textsearch regressions, vector indexing/vacuum, pg_partman maintenance, 37 focused tests, and release/docs checks. No repository files changed.
tokens used
VERDICT: REQUEST_CHANGES

  1. Blocker — RC 1 removes the SQL/PGQ support required to start the engine. Dockerfile.postgres:78 selects a server that rejects CREATE PROPERTY GRAPH, executed by migration p9_17_0038:1280. I reproduced this on arm64; amd64 contract CI reports the same failure. Fresh setup cannot complete. PostgreSQL explicitly removed SQL/PGQ in Beta 4. Simplest fix: retain the working Beta 3 foundation and mark this plan item blocked by that removal.

  2. Minor — the pgvector availability claim is incorrect. docker/README.md:17 says no newer build exists, but PGDG publishes postgresql-19-pgvector 0.8.7-1.pgdg13+1 for both architectures in its archive. Simplest fix: remove or qualify that sentence; changing the tested pin is unnecessary.

  3. Minor — docs call an unpublished image published. requirements/page.mdx:38 lists 19rc1-0.17.2 as published; registry inspection returns manifest unknown. Simplest fix: describe the local-build fallback until publication. The Compose/release coordinates themselves satisfy the release contract.

  4. Minor — current-state beta descriptions remain. install/page.mdx:91 and choose/page.cloud.mdx:33 still describe the runtime as beta. Simplest fix if retaining the RC change: use “prerelease” and regenerate llms-full.txt.

Disposition (Claude)

  • Blocker 1 accepted and confirmed. PostgreSQL 19 Beta 4 reverted SQL/PGQ (release notes, Changes Since Beta 3: "Revert SQL/PGQ (property graph query) support"). On the RC 1 image CREATE PROPERTY GRAPH is a syntax error, so migration p9_17_0038 fails and the engine cannot be set up. The Beta 4 headers had already dropped the pg_propgraph_* catalogs. This PR stays a draft and is not merged. Moving to RC 1 first needs the D98 graph rebuilt without SQL/PGQ, and that is an owner decision. I have escalated it. Main stays on Beta 3.
  • Minors 2 to 4 are moot while the PR is blocked. If it is revived, fix them then.

@fazpu fazpu changed the title build(postgres): move the engine image to PostgreSQL 19 RC 1 [BLOCKED] build(postgres): move the engine image to PostgreSQL 19 RC 1 Nov 6, 2026
@fazpu fazpu changed the title [BLOCKED] build(postgres): move the engine image to PostgreSQL 19 RC 1 PostgreSQL 19 RC 1: replace SQL/PGQ with relational one-hop joins and move the engine image Nov 6, 2026
@fazpu
fazpu force-pushed the chore/postgres-19-rc1 branch from 19537ac to 722566a Compare November 6, 2026 20:52
@fazpu

fazpu commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Codex review round 2 (gpt-6.1-sol, max effort), on d12f53a

VERDICT: REQUEST_CHANGES

  1. Major — Default Compose pairs RC 1 with the old SQL/PGQ engine. compose.yaml:139 selects RC 1, but line 12 still selects published engine 0.17.2. Compose prefers that existing image, whose migrations execute CREATE PROPERTY GRAPH. A fresh default startup therefore fails setup; CI’s --build bypasses this mismatch. Simplest fix: make the source-checkout startup build the current engine alongside RC 1 until matching release images exist.

  2. Minor — The install guide describes a different PostgreSQL version than it installs. install/page.mdx:19 checks out v0.17.2, which uses Beta 3, while line 91 now promises a release candidate. Simplest fix: distinguish the published release instructions from the RC 1 source build, then regenerate llms-full.txt.

  3. Minor — Binding designs still require the removed mechanism. retrieval_design.md:8 requires SQL/PGQ one-hop statements; packaging_distribution_design.md:5 requires native SQL/PGQ; locomo_benchmark_design.md:348 requires property-graph catalog checks. Simplest fix: reconcile these surviving contracts with D98’s relational joins, views, and helpers.

Verification: 231 tests passed on the supplied RC 1 database, covering graph reads, the fence, migrations, readiness, repair, and downgrade cases. Docs and release checks passed. No one-hop result discrepancy found; no ingestion reuse keys touched. Beta 3 upgrade/restore was inspected but not rerun. I modified no files.

Review target was d12f53a9c. CI-only commit 19537ac1e arrived during review; these findings remain there.

Disposition (Claude), fixed in 722566a

  • Major 1: fixed, scoped to documentation.
    • The tagged install (git checkout v0.17.2) already pairs the 0.17.2 engine with its Beta 3 image. The release contract requires compose.yaml on main to name the current version for both images, and the next release publishes a matching pair.
    • So the mismatch exists only on an unreleased main checkout started without --build. compose.yaml and the requirements page now say to use --build there and explain why. Changing the image pins would break check_release_contract.py.
  • Minor 2: fixed. The install page says "PostgreSQL 19 prerelease".
  • Minor 3: fixed. Reconciled retrieval_design.md, packaging_distribution_design.md, locomo_benchmark_design.md, postgres_p1_search_projection_design.md, entity_identity_and_retrieval_design.md, the two unified designs and requirements_v3.md.
  • Also:
    • Rebased onto main. The migration is renumbered to p9_43_0064, after main's p9_42_0063_entity_counts_demand.
    • Spine suite on RC 1: 588 passed before the rebase.
    • After the rebase: migrations, readiness, query-space manifest and graph tests passed, 107 tests.

@fazpu

fazpu commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Codex review round 3 (gpt-6.1-sol, max effort), on 722566a

VERDICT: REQUEST_CHANGES

  1. Major — Round-2 startup finding remains in both quickstarts. README.md:106 and quickstart/page.mdx:51 clone main and start without --build. That pairs published engine 0.17.2 with RC 1, so setup fails on the old property-graph DDL. The new warning elsewhere leaves these instructions broken. Simplest fix: add --build to both commands and regenerate llms-full.txt.

  2. Major — The TypeScript metadata refresh omitted its generated copies. metadata.json:8 has the new hash, while src/version.generated.ts and src/metadata.generated.ts retain the old one. All four TypeScript CI jobs fail with Package version export drift. Simplest fix: run npm run generate in packages/typescript-client and commit the generated updates.

Round-2 minors 2 and 3 are resolved. The migration chain is correct, and all three compatibility-matrix jobs pass.

Verification: 795 local tests passed on the supplied RC 1 database. Docs and release checks passed. Beta 3 upgrade/restore was not rerun. No ingestion reuse keys changed, no repository files modified, and no other containers touched.

Disposition (Claude)

  • Major 1: fixed in 82e9504. README.md and start/quickstart clone main, so they now run docker compose up -d --build and build both images from the same checkout. The install guide checks out the v0.17.2 tag and stays consistent without a build.
  • Major 2: fixed in 79d34f5 and 82e9504. version.generated.ts and metadata.generated.ts were regenerated with npm run generate, and npm run check:generated passes locally.

@fazpu

fazpu commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Codex review round 4 (gpt-6.1-sol, max effort), on 82e9504

VERDICT: APPROVE

No blocker, major, or minor findings. Both round-3 majors are resolved:

  • README:106 and quickstart:51 now use docker compose up -d --build.
  • Both generated TypeScript metadata copies match the current contract hash.

Passed contract export, TypeScript generation/surface/typecheck, public/cloud docs checks, llms freshness, and release validation.

Backend code and ingestion reuse keys are unchanged since round 3; the 795-test suite was not rerun. CI had no failures observed, with some jobs still running. No repository files modified.

@fazpu
fazpu force-pushed the chore/postgres-19-rc1 branch from 82e9504 to 3ffd7c6 Compare November 6, 2026 21:19
@fazpu

fazpu commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Codex review round 5 (delta after rebase/renumber), on 3ffd7c6

VERDICT: APPROVE

No blocker, major, or minor findings. No fixes required.

  • Single linear chain: p9_42_0063 → p9_43_0064 → p9_44_0065.
  • Test, CI, and documentation references are correct; D145 retains p9_43_0064.
  • Range-diff shows only expected rebase overlap and renumbering.
  • Structural migration test passed. Read-only RC 1 database query confirms head p9_44_0065.

Worktree unchanged.

fazpu and others added 7 commits November 6, 2026 22:38
The reference image moves from 19beta3 to 19rc1-trixie, pinned by digest
(owner, 2026-11-06), through Dockerfile.postgres, Compose, the release
workflow tag, RELEASING.md, the docs and a D98 amendment.

- pg_textsearch v1.5.1 uses INT_MAX without including <limits.h>, which
  the RC 1 headers no longer pull in (timescale/pg_textsearch#586). The
  build force-includes the header through CPPFLAGS; the source stays
  unmodified, and the 82 upstream regression tests pass.
- pgvector moves to the PGDG rebuild 0.8.6-1.pgdg13+2 (against Beta 4);
  the access-method headers it uses are unchanged in RC 1.
- RC 1 changes the catalog version, so a Beta 3 data directory does not
  open under it; the upgrades page says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
…eSQL 19 RC 1

PostgreSQL 19 Beta 4 reverted SQL/PGQ, so RC 1 cannot parse CREATE
PROPERTY GRAPH or GRAPH_TABLE and fresh setup failed in p9_17_0038.
The D98 live graph stays; only its query mechanism changes.

- The one-hop neighborhood is a static join over the existing
  relations_current/relations_history edge views, one UNION ALL branch
  per edge direction, after the same guard-first admission. The D140
  evidence gate sits above an OFFSET 0 fence so it never runs on every
  relation of the deployment.
- Property graphs, their grants, and the property-graph catalog/ACL
  readiness checks are removed. The catalog check verifies the node and
  edge views exist, plus helpers, citation traversal and roles. The ops
  graph-catalog output drops `definitions`; readiness reason codes
  graph_pgq_* become graph_one_hop_*.
- p9_17/p9_38/p9_40 no longer create or grant the property graphs and
  use a guarded drop (only a Beta 3 store can hold relkind 'g'). New
  p9_42_0063 drops them from Beta 3 stores at the prior head.
- D98 amendment, design/analysis reconciliation, upgrade docs, and a
  test that fresh setup reaches head on a server without SQL/PGQ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
…ct hash

Engines up to 0.17.2 create SQL/PGQ property graphs in p9_17_0038, which
the RC 1 server built from Dockerfile.postgres cannot parse. The
compatibility matrix now starts the PostgreSQL image each released
engine shipped with; the candidate still runs on the branch's image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
- Renumber the property-graph drop to p9_43_0064 after main's
  p9_42_0063_entity_counts_demand; head assertions follow.
- Compose and requirements: a main checkout between releases starts with
  --build, because the published 0.17.2 engine needs Beta 3.
- Install page no longer says release candidate for the v0.17.2 checkout.
- Reconcile the remaining SQL/PGQ and property-graph statements in
  retrieval, packaging, P1 search, locomo, identity, distribution and
  documentation designs and requirements_v3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
- README and the quickstart clone main, so they start with
  `docker compose up -d --build`: the engine and PostgreSQL images are
  built from the same checkout and match.
- Regenerate src/metadata.generated.ts with npm run generate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
…aim leases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
@fazpu
fazpu force-pushed the chore/postgres-19-rc1 branch from 3ffd7c6 to f3f3f85 Compare November 6, 2026 21:39
@fazpu
fazpu marked this pull request as ready for review November 6, 2026 21:39
@fazpu
fazpu merged commit 9767958 into main Nov 6, 2026
21 checks passed
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.

1 participant