]> granicus.if.org Git - postgresql/commit
Change ps_status.c to explicitly track the current logical length of ps_buffer.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 May 2010 19:20:06 +0000 (19:20 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 May 2010 19:20:06 +0000 (19:20 +0000)
commitdbfa55f73aa32cb743b4d0d497fa8cea01863a6a
tree4bb3008bfee1cb7baf4b0633dd486a1dd8206c19
parentb5285c19eb73608f860fa8ba69a0905413f65b67
Change ps_status.c to explicitly track the current logical length of ps_buffer.
This saves cycles in get_ps_display() on many popular platforms, and more
importantly ensures that get_ps_display() will correctly return an empty
string if init_ps_display() hasn't been called yet.  Per trouble report
from Ray Stell, in which log_line_prefix %i produced junk early in backend
startup.

Back-patch to 8.0.  7.4 doesn't have %i and its version of get_ps_display()
makes no pretense of avoiding pad junk anyhow.
src/backend/utils/misc/ps_status.c