[PG19] pg_upgrade --check passes, then the upgrade fails

Started by shihao zhongabout 24 hours ago1 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t254362
psql -h localhost -U postgres

Built from patchset v1 (message #1), October 24, 2026 at 04:16 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t254362_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t254362_1 && git checkout t254362_1

Patchset v1 (message #1) is on t254362_1

Jump to latest
#1shihao zhong
zhong950419@gmail.com

i hackers,

From 18 to 19, pg_upgrade --check passes for both of these, then the
upgrade fails:

alter role app set standard_conforming_strings = off;
ERROR: non-standard string literals are not supported

create cast (uuid as bytea) with function uuid_send(uuid);
ERROR: cast from type uuid to type bytea already exists

With the patches, --check reports these before the upgrade starts.
0001 lists roles, databases and functions that store a setting the new
cluster rejects.

0002 lists user casts that are now built in. Both ask the new cluster,
so the next removed setting or new cast is caught too.

Both work like check_loadable_libraries(), which collects names from the
old cluster and tries them on the new one.

0003 is a optional test

I think this is a 19 open item.

Thanks,
Shihao

Attachments:

t254362_1
v3-0002-pg_upgrade-Check-user-defined-casts-against-the-n.patchapplication/octet-stream; name=v3-0002-pg_upgrade-Check-user-defined-casts-against-the-n.patchDownload+136-1
v3-0001-pg_upgrade-Check-stored-settings-against-the-new-.patchapplication/octet-stream; name=v3-0001-pg_upgrade-Check-stored-settings-against-the-new-.patchDownload+258-2
v3-0003-pg_upgrade-Test-a-stored-setting-unknown-to-the-n.patchapplication/octet-stream; name=v3-0003-pg_upgrade-Test-a-stored-setting-unknown-to-the-n.patchDownload+33-2