Skip to content

fix(core-postgres): read the catalogs of PostgreSQL 10 to 13 - #4613

Open
datlechin wants to merge 2 commits into
mainfrom
fix/4609-postgres-pre-13-catalogs
Open

datlechin wants to merge 2 commits into
mainfrom
fix/4609-postgres-pre-13-catalogs

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • The PostgreSQL driver reads the catalogs of 10, 11, 12 and 13. Connecting to 12 failed on pg_trigger.tgparentid (13); 11 and 10 also failed on prokind, indnkeyatts, conparentid, attgenerated, collisdeterministic and starts_with.
  • New CatalogRelease renders each catalog statement for the server: a column a later release added is written as a placeholder at its spot, with what the older release has in its place. It replaces the three ad-hoc release flags.
  • starts_with becomes left() and collisdeterministic is read through to_jsonb, so neither needs a gate.
  • Before 14 a never-analysed table now has no row estimate instead of 0 rows, so the grid offers a count rather than running one.
  • On 10 and 11 a partitioned table's size sums its partitions: one pg_inherits walk for every release.
  • A server before 10 is refused at connect with MinimumVersion ("This needs PostgreSQL 10 or later.").
  • Each UnsupportedFeature has a stable code, which the FFI adds as the error's most specific code. Windows words the minimum version; other features keep the generic sentence.
  • Fixtures for PostgreSQL 10, 11 and 12. README, docs/testing.md and docs/drivers/postgresql.md state the new floor; the README's SQLite floor now says 3.43.0, which the driver requires.

Tests changed on purpose: ffi/tests/browse.rs, ffi/src/session.rs, DatabaseSwitchTests.cs and BrowseTests.cs expect the feature code as the primary code.

Test plan

  • every_read_and_a_save_work_before_14 (new, docker): on 10, 11, 12 and 13, every catalog read, a row save, resolve_commit, the editor's result origin, the estimate before and after ANALYZE, and the information_schema comparison.
  • a_release_before_13_connects (new, session crate): the app's connect path on 12.
  • Unit: every statement rendered for 10 to 18 has no bare call, no placeholder left and no column newer than the release; the floor refuses 90624.
  • tablepro-driver-postgres docker suite on 17: 187 pass; 4 fail on this Mac only (Unix socket through Docker Desktop, macOS TLS verifier, Linux cgroup file).

Fixes #4609

@datlechin
datlechin enabled auto-merge (squash) November 26, 2026 12:29

This branch has not been deployed

No deployments
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.

Can not connect to Postgres version 12.22

1 participant