Repository navigation
fix(postgrest-typegen): infer nullability on PostgreSQL 14 - #355
Conversation
|
No actionable comments were generated in the recent review. Summary
Change: Bug fix Merge Risk:
|
231e8e8 to
4a2ef38
Compare
PostgreSQL 14 names range table entries RTE in its node trees where later versions write RANGETBLENTRY, so the query tree walk proved nothing there and every view and RETURNS TABLE column came out nullable. The walk now accepts both, and the parity goldens run on PostgreSQL 14, the oldest version the Supabase CLI accepts, as well as on 15.
18f64d6 to
0f5bf71
Compare
🤖 I have created a release *beep* *boop* --- ## [0.8.1](postgrest-typegen/v0.8.0...postgrest-typegen/v0.8.1) (2026-11-12) ### Bug Fixes * **postgrest-typegen:** infer nullability on PostgreSQL 14 ([#355](#355)) ([35647c3](35647c3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
The Supabase CLI is dropping PostgreSQL 13, which makes 14 the oldest version
introspect()has to support. On 14, view column nullability andRETURNS TABLEcolumn nullability inferred nothing: PostgreSQL 14 writes range table entries asRTEin its node trees, where 15 and later writeRANGETBLENTRY, and the walk only accepted the latter. Every view column and everyRETURNS TABLEcolumn on a PostgreSQL 14 database was therefore generated as nullable. The walk now accepts both names, and on 14 the full test fixture produces exactly the same output as on 15.To keep the minimum supported version working, the parity test now runs on PostgreSQL 14 (
MINIMUM_POSTGRES_VERSION) as well as 15, against the same golden files. A query that reads a catalog column added after 14, or any other difference in what 14 produces, fails every pull request. The view andRETURNS TABLEnullability suites include 14 too. Without the fix, 11 tests fail on 14; with it, the full suite passes. The README has a new "Supported PostgreSQL versions" section that names the minimum and where it is enforced.Generated output on PostgreSQL 15 and later is unchanged.
Context: supabase/cli#7585 (comment) found that 0.8.0 fails on PostgreSQL 13, because it reads
pg_proc.prosqlbody, which exists from 14. With 13 no longer supported, that query stays as it is.