Re: signed logging format for pid in log_line_prefix?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: signed logging format for pid in log_line_prefix?
Date: 2017-09-01 17:02:54
Message-ID: 20433.1504285374@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> I wonder if we could just adopt pid_t for PIDs.

We could (if somebody is willing to find and change all the relevant
declarations). But that doesn't do anything at all to clarify which
printf format code to use for them.

Note that the POSIX snippet you quote doesn't actually guarantee that
pid_t is not wider than "long". So while we could convert all these
places to
printf("...%ld...", (long) pid_t_variable_here);
that's still not formally correct.

Since we have yet to see a platform where our current habit of casting
pids to int doesn't work just as well, I'm inclined not to bother
changing anything here.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-09-01 17:10:23 Re: GnuTLS support
Previous Message Robert Haas 2017-09-01 17:00:37 Re: [PATCH] Document the order of changing certain settings when using hot-standby servers