| From: | Bohyun Lee <bohyun(dot)lee(at)databricks(dot)com> |
|---|---|
| To: | shihao zhong <zhong950419(at)gmail(dot)com> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: pg_upgrade doesn't copy ICU rules on template0 |
| Date: | 2026-10-29 12:55:17 |
| Message-ID: | CAMPh8Mpz=VNv1kxDL+Y3T4Ec_poGaFo3ZvVcEHq7-aHOQGt2kw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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 <zhong950419(at)gmail(dot)com> 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
>
>
>
| Attachment | Content-Type | Size |
|---|---|---|
| v1-pg_upgrade-template0-icu-rules.patch | application/octet-stream | 10.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Fujii Masao | 2026-10-29 12:37:50 | Re: 041_checkpoint_at_promote.pl might fail due to race condition on child kill |