Thanks, addressing this problem in a separate thread seems better. Attached patch file contains a separate ICU-rules fix.
> PQescapeLiteral(), which is used to escape the other options, should > handle newlines just fine. And if we're worried about exceeding the > query buffer, I think we should teach executeQueryOrDie() to grow the > buffer. pg_log() might not deal nicely with arbitrarily long inputs > either, though. Agreed. The patch extends the existing UPDATE executed through executeQueryOrDie() per Heikki's suggestion. Both query and logging buffers now use StringInfo to grow as needed, preserving long rules and full error diagnostics. > Why does it have separate branches for different target cluster versions? Right, those branches are unnecessary because pg_upgrade only supports its own major version as the target. I removed them, and kept only the source version checks required for older catalog layouts. Best regards, Bohyun On Thu, Oct 29, 2026 at 2:43 AM shihao zhong <[email protected]> wrote: > Hi, > > > Uh ... say what? template0 is supposed to be immutable after initdb. > > I think the actual problem here is with whatever patch introduced > > the possibility of this value changing. > > Users can't change template0 after initdb. The value changes inside > pg_upgrade. Since 16, set_locale_and_encoding() copies the old > template0's locale fields into the new template0 (9637badd9f9). That > way the new cluster doesn't need the same initdb options. It misses > daticurules. > > Thanks, > Shihao > > >
v1-pg_upgrade-template0-icu-rules.patch
Description: Binary data
