From 793be249a2c71ddc4fcdb5af61b28cc93aaf6418 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 27 Nov 2026 23:46:09 +0100 Subject: [PATCH] fix(postgres): let plugin SQL keep its uuid columns and casts on every server PostgreSQL 19's catalog brings a uuid(bytea) conversion, and once its name joined the catalog list the guard refused every uuid it read as a call or a field: `t.uuid` and `uuid($1)` failed on 14 to 18 too, where they had always passed. uuid joins the other type name conversions on the plugin allowlist, so PGPLUG-022 checks its overloads on the 19 lane. --- server/assets/postgres/plugin-functions.txt | 1 + server/tests/unit/db/engine/postgres/plugin-sql-guard.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/server/assets/postgres/plugin-functions.txt b/server/assets/postgres/plugin-functions.txt index d96545a91..918aa1db7 100644 --- a/server/assets/postgres/plugin-functions.txt +++ b/server/assets/postgres/plugin-functions.txt @@ -180,6 +180,7 @@ time timestamp timestamptz timetz +uuid varbit varchar diff --git a/server/tests/unit/db/engine/postgres/plugin-sql-guard.test.ts b/server/tests/unit/db/engine/postgres/plugin-sql-guard.test.ts index 5b5cd7bbb..f68a65513 100644 --- a/server/tests/unit/db/engine/postgres/plugin-sql-guard.test.ts +++ b/server/tests/unit/db/engine/postgres/plugin-sql-guard.test.ts @@ -104,6 +104,8 @@ describe('plugin SQL guard', () => { 'CREATE TYPE span AS RANGE (subtype = float8)', 'CREATE TABLE index (x int)', 'CREATE INDEX ON notes (body)', + // PostgreSQL 19 added a uuid() conversion to the catalog; a uuid column and the cast still pass. + 'SELECT t.uuid FROM items t WHERE t.uuid = uuid($1)', ])('lets through %s', (sql) => { expect(() => check(sql)).not.toThrow(); });