Skip to content

Commit 6787e53

Browse files
committed
pg_upgrade: Print OID using %u instead of %d
This could write wrong output into the cluster deletion script if a database OID exceeds the signed 32-bit range.
1 parent fc0fefb commit 6787e53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/pg_upgrade/check.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
600600
PATH_SEPARATOR);
601601

602602
for (dbnum = 0; dbnum < old_cluster.dbarr.ndbs; dbnum++)
603-
fprintf(script, RMDIR_CMD " %c%s%c%d%c\n", PATH_QUOTE,
603+
fprintf(script, RMDIR_CMD " %c%s%c%u%c\n", PATH_QUOTE,
604604
fix_path_separator(os_info.old_tablespaces[tblnum]),
605605
PATH_SEPARATOR, old_cluster.dbarr.dbs[dbnum].db_oid,
606606
PATH_QUOTE);

0 commit comments

Comments
 (0)