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.
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.

greenplum-db/gpdb,ovr/postgres-xl,techdragon/Postgres-XL,arcivanov/postgres-xl,yazun/postgres-xl,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,techdragon/Postgres-XL,tpostgres-projects/tPostgres,Postgres-XL/Postgres-XL,postmind-net/postgres-xl,ashwinstar/gpdb,Postgres-XL/Postgres-XL,ovr/postgres-xl,Postgres-XL/Postgres-XL,xinzweb/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,techdragon/Postgres-XL,arcivanov/postgres-xl,lisakowen/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,tpostgres-projects/tPostgres,zeroae/postgres-xl,kmjungersen/PostgresXL,adam8157/gpdb,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,lisakowen/gpdb,kmjungersen/PostgresXL,ovr/postgres-xl,greenplum-db/gpdb,postmind-net/postgres-xl,adam8157/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,techdragon/Postgres-XL,postmind-net/postgres-xl,snaga/postgres-xl,kmjungersen/PostgresXL,jmcatamney/gpdb,oberstet/postgres-xl,oberstet/postgres-xl,ashwinstar/gpdb,adam8157/gpdb,yazun/postgres-xl,oberstet/postgres-xl,jmcatamney/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,postmind-net/postgres-xl,pavanvd/postgres-xl,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,Postgres-XL/Postgres-XL,lisakowen/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,techdragon/Postgres-XL,jmcatamney/gpdb,zeroae/postgres-xl,xinzweb/gpdb,yazun/postgres-xl,50wu/gpdb,xinzweb/gpdb,zeroae/postgres-xl,zeroae/postgres-xl,yazun/postgres-xl,oberstet/postgres-xl,lisakowen/gpdb,kmjungersen/PostgresXL,yazun/postgres-xl,pavanvd/postgres-xl,zeroae/postgres-xl,oberstet/postgres-xl,adam8157/gpdb,pavanvd/postgres-xl,adam8157/gpdb,ashwinstar/gpdb,snaga/postgres-xl,jmcatamney/gpdb,50wu/gpdb,xinzweb/gpdb,jmcatamney/gpdb,50wu/gpdb,snaga/postgres-xl,xinzweb/gpdb,kmjungersen/PostgresXL,adam8157/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,arcivanov/postgres-xl,lisakowen/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,tpostgres-projects/tPostgres,tpostgres-projects/tPostgres,50wu/gpdb,ovr/postgres-xl,jmcatamney/gpdb,lisakowen/gpdb,adam8157/gpdb,jmcatamney/gpdb,tpostgres-projects/tPostgres,snaga/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl