#ifndef BACKEND_STARTUP_H
#define BACKEND_STARTUP_H
#include "utils/timestamp.h"
extern PGDLLIMPORT bool Trace_connection_negotiation;
extern PGDLLIMPORT uint32 log_connections;
extern PGDLLIMPORT char *log_connections_string;
extern PGDLLIMPORT struct ConnectionTiming conn_timing;
typedef enum CAC_state
{
CAC_OK,
CAC_STARTUP,
CAC_SHUTDOWN,
CAC_RECOVERY,
CAC_NOTHOTSTANDBY,
CAC_TOOMANY,
} CAC_state;
typedef struct BackendStartupData
{
CAC_state canAcceptConnections;
TimestampTz socket_created;
TimestampTz fork_started;
} BackendStartupData;
typedef enum LogConnectionOption
{
LOG_CONNECTION_RECEIPT = (1 << 0),
LOG_CONNECTION_AUTHENTICATION = (1 << 1),
LOG_CONNECTION_AUTHORIZATION = (1 << 2),
LOG_CONNECTION_SETUP_DURATIONS = (1 << 3),
LOG_CONNECTION_ON =
LOG_CONNECTION_RECEIPT |
LOG_CONNECTION_AUTHENTICATION |
LOG_CONNECTION_AUTHORIZATION,
LOG_CONNECTION_ALL =
LOG_CONNECTION_RECEIPT |
LOG_CONNECTION_AUTHENTICATION |
LOG_CONNECTION_AUTHORIZATION |
LOG_CONNECTION_SETUP_DURATIONS,
} LogConnectionOption;
typedef struct ConnectionTiming
{
TimestampTz socket_create;
TimestampTz ready_for_use;
TimestampTz fork_start;
TimestampTz fork_end;
TimestampTz auth_start;
TimestampTz auth_end;
} ConnectionTiming;
pg_noreturn extern void BackendMain(const void *startup_data, size_t startup_data_len);
#endif