Re: [HACKERS] signed logging format for pid in log_line_prefix? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] signed logging format for pid in log_line_prefix?
Date
Msg-id 20433.1504285374@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] signed logging format for pid in log_line_prefix?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.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 toprintf("...%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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] [PATCH] Document the order of changing certain settingswhen using hot-standby servers
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] GnuTLS support