Fix compiler warning about format on Windows
authorPeter Eisentraut <[email protected]>
Tue, 14 Jan 2020 22:59:18 +0000 (23:59 +0100)
committerPeter Eisentraut <[email protected]>
Tue, 14 Jan 2020 22:59:18 +0000 (23:59 +0100)
On 64-bit Windows, pid_t is long long int, so a %d format isn't
enough.

src/backend/replication/walreceiver.c

index b46411433395843e6266d1730399d0e4c373c543..a5e85d32f31e4916ab8415d3b620e8d167dd9873 100644 (file)
@@ -366,7 +366,8 @@ WalReceiverMain(void)
            if (wal_receiver_create_temp_slot)
            {
                snprintf(slotname, sizeof(slotname),
-                        "pg_walreceiver_%d", walrcv_get_backend_pid(wrconn));
+                        "pg_walreceiver_%lld",
+                        (long long int) walrcv_get_backend_pid(wrconn));
 
                walrcv_create_slot(wrconn, slotname, true, 0, NULL);
                changed = true;