Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
359 changes: 359 additions & 0 deletions .agent-steering-domains.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Diagnostics:
MissingIncludes: None
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a personal clangd/LSP config, not part of the nbtree prefix/HOT change under review. It hardcodes the author's local build layout (CompilationDatabase: build/, -I../../../../src/include) and a long private warning set. Committing per-developer editor/LSP config into a PostgreSQL patch is non-minimal and a guaranteed source of merge noise/rejection on -hackers; keep it in a local untracked overlay (e.g. via a top-level .gitignore) rather than tracking it.

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This entire file is personal, developer-local editor configuration (clangd/compile_commands) that must not be committed to the PostgreSQL tree. It hardcodes a build/ CompilationDatabase path and a specific warning set, and belongs in a user's ignored local config, not in a patch destined for pgsql-hackers/commitfest. Including it violates the minimal-diff rule and is unrelated to the stated nbtree prefix-compression feature. Please drop it from the patch and add it to a personal (global or local) gitignore instead.

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This file (and the rest of this group: .envrc, .gdbinit, .local-gitignore, .mcp.json, flake.nix, shell.nix, pg-aliases.sh) is a personal developer-environment artifact that must not be committed to the PostgreSQL tree. The repository's own top-level .gitignore documents the policy explicitly: "Auxiliary files from local workflows, your preferred editor, etc. should be ignored locally using $GIT_DIR/info/exclude or ~/.gitexclude." Committing editor/clangd/debugger/nix configs bloats the diff and is an automatic rejection cause on pgsql-hackers. A patch's diff must be minimal and contain only what the stated change (nbtree prefix/dedup) requires. Please remove these files from the patch and ignore them locally instead. [high confidence]

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This entire group of files (.clangd, .envrc, .gdbinit, .local-gitignore, .mcp.json, flake.nix, pg-aliases.sh, shell.nix) is author-local developer scaffolding and must not be committed to the PostgreSQL tree. The project's own top-level .gitignore documents this policy explicitly: "Auxiliary files from local workflows, your preferred editor, etc. should be ignored locally using $GIT_DIR/info/exclude or ~/.gitexclude." Bundling this with the nbtree/HOT feature work violates the minimal-diff and single-purpose-commit rules and would be an immediate rejection on pgsql-hackers. Move these to a local git exclude instead of tracking them. [high confidence]

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Editor/tooling config (.clangd) is personal developer scaffolding and should not ship in a PostgreSQL patch. It is unrelated to the nbtree-prefix source change, violates the minimal-diff rule, and will draw an outright rejection on -hackers. Keep it local via a personal global gitignore (core.excludesFile) rather than committing it.

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This file (and the rest of the added set: .envrc, .gdbinit, .local-gitignore, .mcp.json, flake.nix, shell.nix, pg-aliases.sh, plus glibc-no-fortify-warning.patch) is private, machine-specific developer scaffolding. It must not be committed to the PostgreSQL tree or posted to pgsql-hackers: it violates the minimal-diff rule and is an automatic rejection reason. The repo's own .gitignore already documents the intended mechanism for such files ("Auxiliary files from local workflows, your preferred editor, etc. should be ignored locally using $GIT_DIR/info/exclude or ~/.gitexclude"). Move these out of version control (the added .local-gitignore itself implies this was the intent). Note CompilationDatabase: build/ also hardcodes a local layout.

InlayHints:
Enabled: true
ParameterNames: true
DeducedTypes: true
CompileFlags:
CompilationDatabase: build/ # Search build/ directory for compile_commands.json
Remove: [ -Werror ]
Add:
- -DDEBUG
- -DLOCAL
- -DPGDLLIMPORT=
- -DPIC
- -O2
- -Wall
- -Wcast-function-type
- -Wconversion
- -Wdeclaration-after-statement
- -Wendif-labels
- -Werror=vla
- -Wextra
- -Wfloat-equal
- -Wformat-security
- -Wimplicit-fallthrough=3
- -Wmissing-format-attribute
- -Wmissing-prototypes
- -Wno-format-truncation
- -Wno-sign-conversion
- -Wno-stringop-truncation
- -Wno-unused-const-variable
- -Wpointer-arith
- -Wshadow
- -Wshadow=compatible-local
- -fPIC
- -fexcess-precision=standard
- -fno-strict-aliasing
- -fvisibility=hidden
- -fwrapv
- -g
- -std=c11
- -I.
- -I../../../../src/include
10 changes: 10 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Inherit shared CFLAGS from ~/ws/postgres/.envrc, load this worktree's
# flake, then layer the postgres agent context (helpers need flake's PATH +
# write into this worktree's dir).
source_up

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This .envrc hardcodes a personal, machine-specific path: source_up pulls in ~/ws/postgres/.envrc (per the comment), which no other contributor has. Combined with use flake/use project_steering/use project_mcp, this is purely a local direnv workflow and will not work for anyone else. It should be ignored locally, not committed. [high confidence]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

source_up and the comment reference a hardcoded personal path (~/ws/postgres/.envrc), and use project_mcp postgresq depends on a non-standard direnv setup. This file is personal environment state and non-portable; it should not be tracked in the PostgreSQL tree.

watch_file flake.nix
Comment on lines +4 to +5

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This direnv file is personal environment scaffolding unrelated to the patch. It also hardcodes an author-specific path assumption: source_up pulls in ~/ws/postgres/.envrc (per the comment), and it loads private MCP/steering contexts. It will do nothing useful for any other developer and should not be tracked in the patch.

use flake
Comment on lines +4 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.envrc is developer-local direnv configuration and must not be part of the patch. It source_ups a machine-specific ~/ws/postgres/.envrc and invokes private helpers (project_steering, project_mcp) that do not exist in this repo, so it is neither reproducible nor relevant to the nbtree prefix-compression change. This violates the minimal-diff rule (unrelated files are a top rejection reason on -hackers). Remove it and keep it in a local/global gitignore.

Comment on lines +4 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

direnv config referencing a personal layout (~/ws/postgres/.envrc, project_steering/project_mcp helpers) does not belong in the committed patch. It is unrelated to the source change and will be rejected. Remove from the patch.

use project_steering c aws
use project_steering postgresql
use project_mcp postgresq
use project_mcp context7
156 changes: 156 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# HOT Indexed Updates — GDB breakpoints for code review

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This entire file targets a different feature than the patch under review. It documents a "HOT indexed updates patch series" and references symbols (heap_hot_indexed_size, heap_hot_indexed_create_tuple, heap_hot_indexed_read_bitmap, ...) and a flag HEAP_INDEXED_UPDATED that do NOT exist anywhere in this tree (searched src/backend/access/heap/*.c and src/include/access/*.h: no matches). It also pins breakpoints to absolute source line numbers in files outside this review group (heapam.c:3210, heapam.c:4019, pruneheap.c:1802, execIndexing.c:370, indexam.c:299). Line-number breakpoints are inherently brittle and will silently bind to the wrong lines after any edit. This is personal developer tooling tied to an unrelated/unmerged branch; it should not be committed to a patch destined for pgsql-hackers/commitfest. Drop it (keep it in a local untracked overlay instead).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ASCII-only is required in the PostgreSQL tree, but this line uses a non-ASCII em dash (U+2014) in "Updates —". Several comment lines in this file contain em dashes (e.g. "choice", "augmented tuple", "CLI"). Since the whole file should be dropped from the patch this is moot, but if any of it were kept, the em dashes would need to become ASCII "--". [high confidence]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This .gdbinit documents a "HOT indexed updates patch series" that is unrelated to the nbtree prefix/dedup feature in the rest of this change. The referenced symbols do not exist in this tree (code_search for heap_hot_indexed_create_tuple and heap_xlog_indexed_update returns no matches), so these breakpoints target a wholly different/nonexistent patch. In addition, the file:line breakpoints (heapam.c:3210, heapam.c:4019, pruneheap.c:2936, heapam_indexscan.c:182, etc.) are inherently fragile -- any edit shifts them -- making this a correctness hazard even for its intended use. This is both an unrelated-change defect and should be removed from the patch (ignore it locally via $GIT_DIR/info/exclude). [high confidence]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These breakpoints describe a "HOT Indexed Updates" patch series (functions heap_hot_indexed_create_tuple, heap_xlog_indexed_update, etc.) that does not exist anywhere in this change set -- the actual changes under review are all nbtree prefix work. The symbols are present nowhere in the tree except this file, and the hardcoded source line numbers (heapam.c:3210, heapam.c:4019, pruneheap.c:1802, indexam.c:299, ...) are extremely fragile: any edit silently shifts them. This is throwaway, machine-specific debugging state referencing an unrelated/absent patch and must not be committed. Remove it (keep it in a local, gitignored area).

#
# Usage: gdb -x .gdbinit <postgres-binary>
# Or from gdb: source .gdbinit
#
# These breakpoints cover the major code paths introduced or modified by
# the HOT indexed updates patch series. They are organized by subsystem
Comment on lines +6 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This file is personal/stale debugging state and must not be committed to a PostgreSQL patch destined for pgsql-hackers/commitfest. Beyond the minimal-diff violation, these breakpoints are objectively wrong for this changeset: they target a different, unmerged patch series ("HOT indexed updates"). Verified against the tree: heapam.c:3210 is actually /* Now we can release the buffer */ inside heap_delete (not "Main entry: heap_update"), and symbols like heap_hot_indexed_tuple_size, heap_hot_indexed_create_tuple, heap_page_prune_and_freeze do not exist in heapam.c/pruneheap.c. GDB will fail to resolve these breakpoints. Remove this file from the patch (track it via a personal core.excludesFile instead).

# to make it easy to enable/disable groups during debugging.
#
# Tip: to skip to a specific subsystem, disable all then enable selectively:
# disable breakpoints
# enable 1 2 3 # just the update-decision group

# =========================================================================
# 1. UPDATE DECISION — heap_update() HOT/HOT-indexed/non-HOT choice
# src/backend/access/heap/heapam.c
# =========================================================================

# Main entry: heap_update
break heapam.c:3210
Comment on lines +19 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This entire file is out-of-scope developer scaffolding for a different, unmerged feature. The stated change in this tree is nbtree leaf-key prefix compression (see src/backend/access/nbtree/README), but every breakpoint here targets a "HOT indexed updates" patch series that is not present. The named symbols heap_hot_indexed_create_tuple, heap_xlog_indexed_update, heap_hot_search_buffer (and the whole heap_hot_indexed_* family) do not exist anywhere in this source tree, so GDB would reject these breakpoints. Additionally, the line-numbered breakpoints (break heapam.c:3210, heapam.c:4019, pruneheap.c:1802, execIndexing.c:370, indexam.c:299, etc.) silently drift to the wrong code the moment any of those files change. A committed .gdbinit with hard-coded line numbers is a maintenance footgun. This file should not be part of a pgsql-hackers patch.

Comment on lines +19 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These breakpoints are broken and out of scope. (1) The hardcoded absolute line numbers are stale: break heapam.c:3210 is annotated "Main entry: heap_update", but heapam.c:3210 is actually inside heap_delete's buffer-release cleanup in the current tree. Absolute line references silently drift on any edit. (2) The symbols referenced -- heap_hot_indexed_tuple_size, heap_hot_indexed_create_tuple, heap_hot_indexed_serialize_bitmap, heap_xlog_indexed_update, etc. -- do not exist anywhere in src/backend/access/heap/. This file tracks an unrelated/stale HOT-indexed-updates patch state that is not part of this change set, confirming it does not belong in the tree. [high confidence]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Beyond the fact that these breakpoints target a "HOT Indexed Updates" series that does not exist in this nbtree-prefix change set, every file:line breakpoint here (e.g. heapam.c:3210, heapam.c:4019, heapam.c:4033, heapam.c:4101, heapam.c:4147) is pinned to an absolute source line. These silently bind to the wrong statement the moment any line above them shifts, giving misleading debugging sessions with no error. If this file were to be kept at all, breakpoints should be symbolic (function names / conditions), not hardcoded line numbers.


# HOT decision block: pure HOT vs HOT indexed vs non-HOT
# Line 4019: pure HOT (no indexed columns changed)
# Line 4024: HOT indexed path (non-catalog, some indexed columns changed)
# Line 4031: predict augmented tuple size
# Line 4033: size+space check before creating augmented tuple
break heapam.c:4019
break heapam.c:4024
break heapam.c:4033

# Set HEAP_INDEXED_UPDATED flag on new tuple before page insertion
break heapam.c:4101

# Restore HEAP_INDEXED_UPDATED on old tuple (only if it previously had it)
break heapam.c:4147

# =========================================================================
# 2. TUPLE CREATION — building the augmented tuple with embedded bitmap
# src/backend/access/heap/heapam.c
# =========================================================================

# Predict augmented tuple size (returns 0 if t_hoff would overflow)
break heap_hot_indexed_tuple_size

# Create augmented tuple with embedded modified-column bitmap
break heap_hot_indexed_create_tuple

# Serialize Bitmapset into raw bytes in tuple header
break heap_hot_indexed_serialize_bitmap

# =========================================================================
# 3. BITMAP UTILITIES — raw bitmap operations for chain following
# src/backend/access/heap/heapam.c
# =========================================================================

# Compute raw bitmap byte size from natts
break heap_hot_indexed_bitmap_raw_size

# Check if tuple header has room for bitmap between null bitmap and data
break heap_hot_indexed_has_bitmap_space

# Read HOT indexed bitmap from tuple header (returns Bitmapset)
break heap_hot_indexed_read_bitmap

# Fast overlap check: does tuple's raw bitmap overlap with indexed_attrs?
break heap_hot_indexed_bitmap_overlaps_raw

# OR a tuple's raw bitmap into an accumulator buffer
break heap_hot_indexed_bitmap_or_raw

# Check if accumulated raw bitmap overlaps with indexed_attrs
break heap_hot_indexed_accum_overlaps

# Merge bitmaps from dead tuples into a target tuple on the page
break heap_hot_indexed_merge_bitmaps_raw

# Deserialize raw bytes back to Bitmapset
break heap_hot_indexed_deserialize_bitmap

# =========================================================================
# 4. INDEX SCAN — HOT chain following with stale-entry detection
# src/backend/access/heap/heapam_indexscan.c
# =========================================================================

# Main HOT chain search with indexed update awareness
break heap_hot_search_buffer

# Redirect-with-data: initialize bitmap accumulator from collapsed redirect
break heapam_indexscan.c:182

# Accumulate bitmap from INDEXED_UPDATED tuple in chain
break heapam_indexscan.c:250

# Stale entry detection: accumulated bitmap overlaps this index's attrs
break heapam_indexscan.c:297

# =========================================================================
# 5. INDEX SCAN SETUP — indexed_attrs bitmap computation
# src/backend/access/index/indexam.c
# =========================================================================

# Compute indexed_attrs for HOT indexed update chain following
break indexam.c:299

# =========================================================================
# 6. INDEX INSERTION — skip unchanged indexes for HOT indexed updates
# src/backend/executor/execIndexing.c
# =========================================================================

# Entry: insert/update index tuples
break ExecInsertIndexTuples

# Index skip decision: skip indexes whose attrs don't overlap modified set
break execIndexing.c:370

# =========================================================================
# 7. PRUNING — chain collapsing and redirect-with-data
# src/backend/access/heap/pruneheap.c
# =========================================================================

# Main prune function
break heap_page_prune_and_freeze

# Per-chain pruning entry
break heap_prune_chain

# Chain collapsing: collect bitmaps from dead INDEXED_UPDATED intermediates
break pruneheap.c:1802

# OR dead tuple bitmaps into combined bitmap
break pruneheap.c:1836

# Record redirect-with-data for execute phase
break pruneheap.c:1863

# Execute phase: apply redirect-with-data entries on the page
break pruneheap.c:1287

# =========================================================================
# 8. WAL REPLAY — recovery of HOT indexed updates
# src/backend/access/heap/heapam_xlog.c
# =========================================================================

# WAL replay for XLOG_HEAP2_INDEXED_UPDATE
break heap_xlog_indexed_update

# =========================================================================
# 9. WAL LOGGING — writing HOT indexed update records
# src/backend/access/heap/heapam.c
# =========================================================================

# WAL logging for heap updates (handles indexed_update flag)
break log_heap_update

# Serialize redirect-with-data into WAL record (pruneheap.c)
break pruneheap.c:2936
18 changes: 18 additions & 0 deletions .github/workflows/fork-ocr-model-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Weekly check for a newer Claude Opus on Bedrock; opens/updates one issue here
# when OCR_BEDROCK_MODEL is behind. Notify-only (GITHUB_TOKEN cannot write
# Actions variables). Logic lives in gburd/ci-workflows.

name: OCR model self-check

on:
schedule:
- cron: '0 12 * * 1' # Mondays 12:00 UTC
workflow_dispatch:

jobs:
check:
uses: gburd/ci-workflows/.github/workflows/ocr-model-check.yml@v1
with:
aws_role_arn: ${{ vars.AWS_ROLE_ARN }}
aws_region: ${{ vars.AWS_REGION }}
bedrock_model: ${{ vars.OCR_BEDROCK_MODEL }}
43 changes: 43 additions & 0 deletions .github/workflows/fork-ocr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# AI PR review (Claude Opus on Bedrock). Logic and review rules live in
# gburd/ci-workflows so this fork's master carries a stub instead of ~1000
# lines that have to be rebased onto upstream forever.
#
# Needs repo variables AWS_ROLE_ARN, AWS_REGION, OCR_BEDROCK_MODEL. Auth is
# GitHub OIDC; no static AWS keys. See the ci-workflows README.

name: OCR AI Review

on:
pull_request:
# Note: no draft filter — drafts are reviewed too.
types: [opened, synchronize, reopened, ready_for_review]
issue_comment:
types: [created]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to review'
required: true
type: number

# One review per PR; cancel superseded runs to save Bedrock spend.
concurrency:
group: ocr-review-${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
cancel-in-progress: true

jobs:
review:
# Comment events only when the comment is on a PR and starts with the
# trigger keyword; PR events and manual dispatch always.
if: |
github.event_name == 'pull_request' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
(startsWith(github.event.comment.body, '/open-code-review') ||
startsWith(github.event.comment.body, '@open-code-review') ||
startsWith(github.event.comment.body, '/pg-history')))
uses: gburd/ci-workflows/.github/workflows/ocr-review.yml@v1
with:
aws_role_arn: ${{ vars.AWS_ROLE_ARN }}
aws_region: ${{ vars.AWS_REGION }}
bedrock_model: ${{ vars.OCR_BEDROCK_MODEL }}
48 changes: 48 additions & 0 deletions .github/workflows/fork-sync-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Keep this fork's master rebased on postgres/postgres master, carrying only
# the fork-owned CI stubs (.github/workflows/fork-*.yml). The workflows they
# call, and the OCR review rules, live in gburd/ci-workflows.
#
# Requires the SYNC_TOKEN secret: a PAT with repo+workflow scope. The default
# GITHUB_TOKEN is not allowed to push commits that touch .github/workflows/,
# and every commit we carry does.

name: Sync from upstream

on:
schedule:
- cron: '17 */3 * * *'
workflow_dispatch:

concurrency:
group: fork-sync-upstream

permissions:
contents: read

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.SYNC_TOKEN }}

- name: Rebase master onto upstream
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/postgres/postgres.git
git fetch --no-tags upstream master

# Master carries fork CI only. Anything else means work landed here
# that belongs on a branch; force-rebasing it on a timer would be wrong.
if git diff --name-only upstream/master...HEAD |
grep -v '^\.github/workflows/fork-'; then
echo "::error::master carries non-CI changes (listed above); move them to a branch"
exit 1
fi

git rebase upstream/master
git push --force-with-lease
3 changes: 3 additions & 0 deletions .local-gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# git config core.excludesFile .local-gitignore

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The .local-gitignore mechanism (git config core.excludesFile .local-gitignore) is exactly what should be used to keep all of these developer-environment files (.clangd, .envrc, .gdbinit, .mcp.json, flake.nix, shell.nix, pg-aliases.sh) OUT of tracking. Tracking this file in the patch inverts its intent: a per-developer local exclude list does not belong in the shared repo/patch. Drop it from the commit.

.local-gitignore
Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a developer-local git-excludes file (referenced by git config core.excludesFile .local-gitignore) and should not be committed to the PostgreSQL tree. It is unrelated to the nbtree prefix-compression feature and only serves one contributor's local workflow. Drop it from the patch.

Comment on lines +1 to +2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a personal git-excludes helper (it even ignores itself). Ironically it documents that these files are meant to be local-only, which is exactly why none of this group (.clangd/.envrc/.gdbinit/.mcp.json/flake.nix/shell.nix/pg-aliases.sh) should be part of the patch. Drop it.


12 changes: 12 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"mcpServers": {
"postgresq": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The server identifier key "postgresq" is missing a trailing l relative to postgresql. It is referenced consistently from .envrc (use project_mcp postgresq), so it may be deliberate, but it reads as a typo and is confusingly close to the other postgres-mcp server key. Rename to postgresql (and update .envrc) unless the truncated name is intentional. (Also: this file is personal MCP config and should not be tracked in the patch.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The mcpServers key "postgresq" is a truncated/misspelled form of postgresql (the .envrc on line 8 uses the full spelling postgresql for project_steering but line 9 uses the truncated postgresq for project_mcp, so even the author's own config is inconsistent on the full vs. truncated name). More fundamentally, this whole file plus the hard-coded personal endpoint https://pg.ddx.io/mcp/ is developer-local scaffolding that should not be committed to a repo destined for pgsql-hackers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The server key "postgresq" looks truncated/misspelled (vs. postgres/postgresql), and .envrc loads the matching use project_mcp postgresq. If this is meant to match a named server it will silently fail; at minimum it is an inconsistent identifier.

"type": "http",
"url": "https://pg.ddx.io/mcp/"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checking in an external MCP server endpoint ("https://pg.ddx.io/mcp/") and a machine-specific nix-store absolute path ("/nix/store/j9ln9cay5m6bn2v1r672i0g7qykiyqx6-postgres-mcp") is non-portable and a trust/exfiltration concern: anyone who opens this repo in an MCP-aware tool would auto-connect to an unknown external server and run a store path that does not exist on their machine. Per the review rule only json-key spelling is in scope -- keys "mcpServers", "type", "url", "args", "command" are spelled correctly -- but this entire file is a personal artifact that should not be in the patch. [medium confidence]

},
"postgres-mcp": {
"args": [],
"command": "/nix/store/j9ln9cay5m6bn2v1r672i0g7qykiyqx6-postgres-mcp"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MCP server config is personal environment state and should not be committed to a PostgreSQL patch. Separately, postgres-mcp hardcodes an absolute, machine-specific Nix store path (/nix/store/j9ln9...-postgres-mcp) that is not reproducible on any other machine, and the server key postgresq is a truncated form of "postgresql" (consistently mis-referenced from .envrc as use project_mcp postgresq). Remove this file from the patch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

postgres-mcp points at a hardcoded nix store path with a specific hash, which is machine-specific and non-reproducible for any other developer. Combined with the external HTTP endpoint above, this confirms the file is personal-environment config that should not be tracked.

}
}
}
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Project instructions

See .agent-steering-domains.md for domain-specific steering (local).
2 changes: 1 addition & 1 deletion contrib/amcheck/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PGFILEDESC = "amcheck - function for verifying relation integrity"

REGRESS = check check_btree check_gin check_heap

EXTRA_INSTALL = contrib/pg_walinspect
EXTRA_INSTALL = contrib/pageinspect contrib/pg_walinspect
TAP_TESTS = 1

ifdef USE_PGXS
Expand Down
Loading
Loading