mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Standardize format for printing PIDs
Most code prints PIDs as %d, but some code tried to print them as long or unsigned long. While this is in theory allowed, the fact that PIDs fit into int is deeply baked into all PostgreSQL code, so these random deviations don't accomplish anything except confusion. Note that we still need casts from pid_t to int, because on 64-bit MinGW, pid_t is long long int. (But per above, actually supporting that range in PostgreSQL code would be major surgery and probably not useful.) Discussion: https://www.postgresql.org/message-id/289c2e45-c7d9-5ce4-7eff-a9e2a33e1580@enterprisedb.com
This commit is contained in:
@ -193,8 +193,8 @@ autoprewarm_main(Datum main_arg)
|
||||
{
|
||||
LWLockRelease(&apw_state->lock);
|
||||
ereport(LOG,
|
||||
(errmsg("autoprewarm worker is already running under PID %lu",
|
||||
(unsigned long) apw_state->bgworker_pid)));
|
||||
(errmsg("autoprewarm worker is already running under PID %d",
|
||||
(int) apw_state->bgworker_pid)));
|
||||
return;
|
||||
}
|
||||
apw_state->bgworker_pid = MyProcPid;
|
||||
@ -303,8 +303,8 @@ apw_load_buffers(void)
|
||||
{
|
||||
LWLockRelease(&apw_state->lock);
|
||||
ereport(LOG,
|
||||
(errmsg("skipping prewarm because block dump file is being written by PID %lu",
|
||||
(unsigned long) apw_state->pid_using_dumpfile)));
|
||||
(errmsg("skipping prewarm because block dump file is being written by PID %d",
|
||||
(int) apw_state->pid_using_dumpfile)));
|
||||
return;
|
||||
}
|
||||
LWLockRelease(&apw_state->lock);
|
||||
@ -599,12 +599,12 @@ apw_dump_now(bool is_bgworker, bool dump_unlogged)
|
||||
{
|
||||
if (!is_bgworker)
|
||||
ereport(ERROR,
|
||||
(errmsg("could not perform block dump because dump file is being used by PID %lu",
|
||||
(unsigned long) apw_state->pid_using_dumpfile)));
|
||||
(errmsg("could not perform block dump because dump file is being used by PID %d",
|
||||
(int) apw_state->pid_using_dumpfile)));
|
||||
|
||||
ereport(LOG,
|
||||
(errmsg("skipping block dump because it is already being performed by PID %lu",
|
||||
(unsigned long) apw_state->pid_using_dumpfile)));
|
||||
(errmsg("skipping block dump because it is already being performed by PID %d",
|
||||
(int) apw_state->pid_using_dumpfile)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -737,8 +737,8 @@ autoprewarm_start_worker(PG_FUNCTION_ARGS)
|
||||
if (pid != InvalidPid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("autoprewarm worker is already running under PID %lu",
|
||||
(unsigned long) pid)));
|
||||
errmsg("autoprewarm worker is already running under PID %d",
|
||||
(int) pid)));
|
||||
|
||||
apw_start_leader_worker();
|
||||
|
||||
|
Reference in New Issue
Block a user