+
+ --char-signedness=option
+
+ Manually set the default char signedness. Possible values are
+ signed and unsigned .
+
+ For a database cluster that pg_upgrade upgraded from
+ a
PostgreSQL version before 18, the safe
+ value would be the default char signedness of the platform
+ that ran the cluster before that upgrade. For all other
+ clusters, signed would be the safe value. However,
+ this option is exclusively for use with pg_upgrade
+ and should not normally be used manually.
+
+
+
+
-c xid ,xid
--commit-timestamp-ids=xid ,xid
static XLogSegNo minXlogSegNo = 0;
static int WalSegSz;
static int set_wal_segsize;
+static int set_char_signedness = -1;
static void CheckDataVersion(void);
static bool read_controlfile(void);
{"oldest-transaction-id", required_argument, NULL, 'u'},
{"next-transaction-id", required_argument, NULL, 'x'},
{"wal-segsize", required_argument, NULL, 1},
+ {"char-signedness", required_argument, NULL, 2},
{NULL, 0, NULL, 0}
};
break;
}
+ case 2:
+ {
+ errno = 0;
+
+ if (pg_strcasecmp(optarg, "signed") == 0)
+ set_char_signedness = 1;
+ else if (pg_strcasecmp(optarg, "unsigned") == 0)
+ set_char_signedness = 0;
+ else
+ {
+ pg_log_error("invalid argument for option %s", "--char-signedness");
+ pg_log_error_hint("Try \"%s --help\" for more information.", progname);
+ exit(1);
+ }
+ break;
+ }
+
default:
/* getopt_long already emitted a complaint */
pg_log_error_hint("Try \"%s --help\" for more information.", progname);
if (set_wal_segsize != 0)
ControlFile.xlog_seg_size = WalSegSz;
+ if (set_char_signedness != -1)
+ ControlFile.default_char_signedness = (set_char_signedness == 1);
+
if (minXlogSegNo > newXlogSegNo)
newXlogSegNo = minXlogSegNo;
(ControlFile.float8ByVal ? _("by value") : _("by reference")));
printf(_("Data page checksum version: %u\n"),
ControlFile.data_checksum_version);
+ printf(_("Default char data signedness: %s\n"),
+ (ControlFile.default_char_signedness ? _("signed") : _("unsigned")));
}
printf(_(" -O, --multixact-offset=OFFSET set next multitransaction offset\n"));
printf(_(" -u, --oldest-transaction-id=XID set oldest transaction ID\n"));
printf(_(" -x, --next-transaction-id=XID set next transaction ID\n"));
+ printf(_(" --char-signedness=OPTION set char signedness to \"signed\" or \"unsigned\"\n"));
printf(_(" --wal-segsize=SIZE size of WAL segments, in megabytes\n"));
printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
qr/must be greater than/,
'fails with -x value too small');
+# --char-signedness
+command_fails_like(
+ [ 'pg_resetwal', '--char-signedness', 'foo', $node->data_dir ],
+ qr/error: invalid argument for option --char-signedness/,
+ 'fails with incorrect --char-signedness option');
+
# run with control override options
my $out = (run_command([ 'pg_resetwal', '--dry-run', $node->data_dir ]))[0];