Skip to content

fix: PostgreSQL build compatibility, schema hash and apply performance - #101

Merged
andinux merged 4 commits into
mainfrom
fix/postgresql-build-hash-apply
Nov 17, 2026
Merged

andinux merged 4 commits into
mainfrom
fix/postgresql-build-hash-apply

Conversation

@andinux

@andinux andinux commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Four fixes, one commit each (please merge with "Rebase and merge" to keep them separate):

  • Supabase image builds against its base's own server headers. Newer PostgreSQL minor releases can add symbols an older server lacks, so the extension is now compiled against the server it runs on.
  • Linux packages are built against the oldest supported minor of each major (15.14, 17.6, 18.0), so one package loads on every later minor of that major. CI pins the matching headers from the PGDG archive and fails if they're missing. The quickstart lists the minimum minors.
  • PostgreSQL schema hash counts each table once. Tables with column settings or filters were counted once per setting, so after an upgrade peers could reject payloads with "schema hash is unknown". The hash now matches SQLite's. New test: 78_schema_hash_table_settings.sql.
  • Applying a large payload on PostgreSQL is no longer quadratic. The per-change site lookup rewrote the same row every time; it now reads first and inserts only new sites. A 2000-row first apply goes from ~6.2 s to ~0.46 s (4000 rows: ~25 s to ~0.83 s). New test: 79_siteid_lookup.sql, including two applies inserting the same new site concurrently.

Tested locally: full SQLite suite, PostgreSQL suite on the standalone image and on a Supabase image, and load tests of the new packages on the oldest and newest minor of each major.

🤖 Generated with Claude Code

@andinux
andinux force-pushed the fix/postgresql-build-hash-apply branch from 767de2a to 24a0965 Compare November 16, 2026 15:14
@andinux
andinux force-pushed the fix/postgresql-build-hash-apply branch from 24a0965 to 3cd2c1d Compare November 16, 2026 15:53
@andinux
andinux merged commit dd4bf51 into main Nov 17, 2026
71 of 72 checks passed
@andinux andinux mentioned this pull request Nov 17, 2026
@andinux
andinux deleted the fix/postgresql-build-hash-apply branch November 17, 2026 22:23
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