diff options
author | Masahiko Sawada <msawada@postgresql.org> | 2025-02-21 10:23:39 -0800 |
---|---|---|
committer | Masahiko Sawada <msawada@postgresql.org> | 2025-02-21 10:23:39 -0800 |
commit | 1aab6805919b84a2f2477132d96f2147ed36150e (patch) | |
tree | f4c2e1a63cb89b032eea833a701db711bc50fcde /doc/src | |
parent | a8238f87f980848c2d69c105555c4383e20e7670 (diff) | |
download | postgresql-1aab6805919b84a2f2477132d96f2147ed36150e.tar.gz postgresql-1aab6805919b84a2f2477132d96f2147ed36150e.zip |
pg_upgrade: Add --set-char-signedness to set the default char signedness of new cluster.
This change adds a new option --set-char-signedness to pg_upgrade. It
enables user to set arbitrary signedness during pg_upgrade. This helps
cases where user who knew they copied the v17 source cluster from
x86 (signedness=true) to ARM (signedness=false) can pg_upgrade
properly without the prerequisite of acquiring an x86 VM.
Reviewed-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/CB11ADBC-0C3F-4FE0-A678-666EE80CBB07%40amazon.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/pgupgrade.sgml | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index 4d9ca2a5616..6f29ffad76b 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -286,6 +286,59 @@ PostgreSQL documentation </varlistentry> <varlistentry> + <term><option>--set-char-signedness=</option><replaceable>option</replaceable></term> + <listitem> + <para> + Manually set the default char signedness of new clusters. Possible values + are <literal>signed</literal> and <literal>unsigned</literal>. + </para> + <para> + In the C language, the default signedness of the <type>char</type> type + (when not explicitly specified) varies across platforms. For example, + <type>char</type> defaults to <type>signed char</type> on x86 CPUs but + to <type>unsigned char</type> on ARM CPUs. + </para> + <para> + Starting from <productname>PostgreSQL</productname> 18, database clusters + maintain their own default char signedness setting, which can be used to + ensure consistent behavior across platforms with different default char + signedness. By default, <application>pg_upgrade</application> preserves + the char signedness setting when upgrading from an existing cluster. + However, when upgrading from <productname>PostgreSQL</productname> 17 or + earlier, <application>pg_upgrade</application> adopts the char signedness + of the platform on which it was built. + </para> + <para> + This option allows you to explicitly set the default char signedness for + the new cluster, overriding any inherited values. There are two specific + scenarios where this option is relevant: + <itemizedlist> + <listitem> + <para> + If you are planning to migrate to a different platform after the upgrade, + you should not use this option. The default behavior is right in this case. + Instead, perform the upgrade on the original platform without this flag, + and then migrate the cluster afterward. This is the recommended and safest + approach. + </para> + </listitem> + <listitem> + <para> + If you have already migrated the cluster to a platform with different + char signedness (for example, from an x86-based system to an ARM-based + system), you should use this option to specify the signedness matching + the original platform's default char signedness. Additionally, it's + essential not to modify any data files between migrating data files and + running <command>pg_upgrade</command>. <command>pg_upgrade</command> + should be the first operation that starts the cluster on the new platform. + </para> + </listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-?</option></term> <term><option>--help</option></term> <listitem><para>show help, then exit</para></listitem> |