PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <signal.h>
#include "catalog/pg_authid.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/syslogger.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "utils/acl.h"
#include "utils/fmgrprotos.h"
Go to the source code of this file.
Macros | |
#define | SIGNAL_BACKEND_SUCCESS 0 |
#define | SIGNAL_BACKEND_ERROR 1 |
#define | SIGNAL_BACKEND_NOPERMISSION 2 |
#define | SIGNAL_BACKEND_NOSUPERUSER 3 |
#define | SIGNAL_BACKEND_NOAUTOVAC 4 |
Functions | |
static int | pg_signal_backend (int pid, int sig) |
Datum | pg_cancel_backend (PG_FUNCTION_ARGS) |
static bool | pg_wait_until_termination (int pid, int64 timeout) |
Datum | pg_terminate_backend (PG_FUNCTION_ARGS) |
Datum | pg_reload_conf (PG_FUNCTION_ARGS) |
Datum | pg_rotate_logfile (PG_FUNCTION_ARGS) |
#define SIGNAL_BACKEND_ERROR 1 |
Definition at line 46 of file signalfuncs.c.
#define SIGNAL_BACKEND_NOAUTOVAC 4 |
Definition at line 49 of file signalfuncs.c.
#define SIGNAL_BACKEND_NOPERMISSION 2 |
Definition at line 47 of file signalfuncs.c.
#define SIGNAL_BACKEND_NOSUPERUSER 3 |
Definition at line 48 of file signalfuncs.c.
#define SIGNAL_BACKEND_SUCCESS 0 |
Definition at line 45 of file signalfuncs.c.
Datum pg_cancel_backend | ( | PG_FUNCTION_ARGS | ) |
Definition at line 136 of file signalfuncs.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, PG_GETARG_INT32, PG_RETURN_BOOL, pg_signal_backend(), SIGNAL_BACKEND_NOAUTOVAC, SIGNAL_BACKEND_NOPERMISSION, SIGNAL_BACKEND_NOSUPERUSER, and SIGNAL_BACKEND_SUCCESS.
Datum pg_reload_conf | ( | PG_FUNCTION_ARGS | ) |
Definition at line 288 of file signalfuncs.c.
References ereport, errmsg(), kill, PG_RETURN_BOOL, PostmasterPid, SIGHUP, and WARNING.
Datum pg_rotate_logfile | ( | PG_FUNCTION_ARGS | ) |
Definition at line 308 of file signalfuncs.c.
References ereport, errmsg(), Logging_collector, PG_RETURN_BOOL, PMSIGNAL_ROTATE_LOGFILE, SendPostmasterSignal(), and WARNING.
|
static |
Definition at line 51 of file signalfuncs.c.
References B_AUTOVAC_WORKER, BackendPidGetProc(), ereport, errmsg(), GetNumberFromPGProc, GetUserId(), has_privs_of_role(), kill, OidIsValid, pgstat_get_beentry_by_proc_number(), PGPROC::roleId, sig, SIGNAL_BACKEND_ERROR, SIGNAL_BACKEND_NOAUTOVAC, SIGNAL_BACKEND_NOPERMISSION, SIGNAL_BACKEND_NOSUPERUSER, SIGNAL_BACKEND_SUCCESS, PgBackendStatus::st_backendType, superuser(), superuser_arg(), and WARNING.
Referenced by pg_cancel_backend(), and pg_terminate_backend().
Datum pg_terminate_backend | ( | PG_FUNCTION_ARGS | ) |
Definition at line 237 of file signalfuncs.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, PG_GETARG_INT32, PG_GETARG_INT64, PG_RETURN_BOOL, pg_signal_backend(), pg_wait_until_termination(), SIGNAL_BACKEND_NOAUTOVAC, SIGNAL_BACKEND_NOPERMISSION, SIGNAL_BACKEND_NOSUPERUSER, and SIGNAL_BACKEND_SUCCESS.
|
static |
Definition at line 169 of file signalfuncs.c.
References CHECK_FOR_INTERRUPTS, ereport, errcode(), errmsg(), errmsg_plural(), ERROR, kill, MyLatch, ResetLatch(), WaitLatch(), WARNING, WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, and WL_TIMEOUT.
Referenced by pg_terminate_backend().