postgresql/src/include/utils/ps_status.h
Peter Eisentraut bf68b79e50 Refactor ps_status.c API
The init_ps_display() arguments were mostly lies by now, so to match
typical usage, just use one argument and let the caller assemble it
from multiple sources if necessary.  The only user of the additional
arguments is BackendInitialize(), which was already doing string
assembly on the caller side anyway.

Remove the second argument of set_ps_display() ("force") and just
handle that in init_ps_display() internally.

BackendInitialize() also used to set the initial status as
"authentication", but that was very far from where authentication
actually happened.  So now it's set to "initializing" and then
"authentication" just before the actual call to
ClientAuthentication().

Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com
2020-03-11 16:38:31 +01:00

25 lines
590 B
C

/*-------------------------------------------------------------------------
*
* ps_status.h
*
* Declarations for backend/utils/misc/ps_status.c
*
* src/include/utils/ps_status.h
*
*-------------------------------------------------------------------------
*/
#ifndef PS_STATUS_H
#define PS_STATUS_H
extern bool update_process_title;
extern char **save_ps_display_args(int argc, char **argv);
extern void init_ps_display(const char *fixed_part);
extern void set_ps_display(const char *activity);
extern const char *get_ps_display(int *displen);
#endif /* PS_STATUS_H */