|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "access/xlog.h"#include "access/xlogprefetcher.h"#include "catalog/catalog.h"#include "catalog/pg_authid.h"#include "catalog/pg_type.h"#include "common/ip.h"#include "funcapi.h"#include "miscadmin.h"#include "pgstat.h"#include "postmaster/bgworker.h"#include "replication/logicallauncher.h"#include "storage/proc.h"#include "storage/procarray.h"#include "utils/acl.h"#include "utils/builtins.h"#include "utils/timestamp.h"
Go to the source code of this file.
Macros | |
| #define | UINT32_ACCESS_ONCE(var) ((uint32)(*((volatile uint32 *)&(var)))) |
| #define | HAS_PGSTAT_PERMISSIONS(role) (has_privs_of_role(GetUserId(), ROLE_PG_READ_ALL_STATS) || has_privs_of_role(GetUserId(), role)) |
| #define | PG_STAT_GET_RELENTRY_INT64(stat) |
| #define | PG_STAT_GET_RELENTRY_FLOAT8(stat) |
| #define | PG_STAT_GET_RELENTRY_TIMESTAMPTZ(stat) |
| #define | PG_STAT_GET_FUNCENTRY_FLOAT8_MS(stat) |
| #define | PG_STAT_GET_PROGRESS_COLS PGSTAT_NUM_PROGRESS_PARAM + 3 |
| #define | PG_STAT_GET_ACTIVITY_COLS 31 |
| #define | PG_STAT_GET_SUBXACT_COLS 2 |
| #define | PG_STAT_GET_DBENTRY_INT64(stat) |
| #define | PG_STAT_GET_DBENTRY_FLOAT8_MS(stat) |
| #define | PG_STAT_WAL_COLS 6 |
| #define | PG_STAT_GET_SLRU_COLS 9 |
| #define | PG_STAT_GET_XACT_RELENTRY_INT64(stat) |
| #define | PG_STAT_GET_XACT_FUNCENTRY_FLOAT8_MS(stat) |
| #define | PG_STAT_GET_REPLICATION_SLOT_COLS 13 |
| #define | PG_STAT_GET_SUBSCRIPTION_STATS_COLS 13 |
Typedefs | |
| typedef enum io_stat_col | io_stat_col |
Enumerations | |
| enum | io_stat_col { IO_COL_INVALID = -1 , IO_COL_BACKEND_TYPE , IO_COL_OBJECT , IO_COL_CONTEXT , IO_COL_READS , IO_COL_READ_BYTES , IO_COL_READ_TIME , IO_COL_WRITES , IO_COL_WRITE_BYTES , IO_COL_WRITE_TIME , IO_COL_WRITEBACKS , IO_COL_WRITEBACK_TIME , IO_COL_EXTENDS , IO_COL_EXTEND_BYTES , IO_COL_EXTEND_TIME , IO_COL_HITS , IO_COL_EVICTIONS , IO_COL_REUSES , IO_COL_FSYNCS , IO_COL_FSYNC_TIME , IO_COL_RESET_TIME , IO_NUM_COLUMNS } |
| #define HAS_PGSTAT_PERMISSIONS | ( | role | ) | (has_privs_of_role(GetUserId(), ROLE_PG_READ_ALL_STATS) || has_privs_of_role(GetUserId(), role)) |
Definition at line 37 of file pgstatfuncs.c.
| #define PG_STAT_GET_ACTIVITY_COLS 31 |
| #define PG_STAT_GET_DBENTRY_FLOAT8_MS | ( | stat | ) |
Definition at line 1203 of file pgstatfuncs.c.
| #define PG_STAT_GET_DBENTRY_INT64 | ( | stat | ) |
Definition at line 1036 of file pgstatfuncs.c.
| #define PG_STAT_GET_FUNCENTRY_FLOAT8_MS | ( | stat | ) |
Definition at line 186 of file pgstatfuncs.c.
| #define PG_STAT_GET_PROGRESS_COLS PGSTAT_NUM_PROGRESS_PARAM + 3 |
| #define PG_STAT_GET_RELENTRY_FLOAT8 | ( | stat | ) |
Definition at line 109 of file pgstatfuncs.c.
| #define PG_STAT_GET_RELENTRY_INT64 | ( | stat | ) |
Definition at line 39 of file pgstatfuncs.c.
| #define PG_STAT_GET_RELENTRY_TIMESTAMPTZ | ( | stat | ) |
Definition at line 137 of file pgstatfuncs.c.
| #define PG_STAT_GET_REPLICATION_SLOT_COLS 13 |
| #define PG_STAT_GET_SLRU_COLS 9 |
| #define PG_STAT_GET_SUBSCRIPTION_STATS_COLS 13 |
| #define PG_STAT_GET_SUBXACT_COLS 2 |
| #define PG_STAT_GET_XACT_FUNCENTRY_FLOAT8_MS | ( | stat | ) |
Definition at line 1832 of file pgstatfuncs.c.
| #define PG_STAT_GET_XACT_RELENTRY_INT64 | ( | stat | ) |
Definition at line 1775 of file pgstatfuncs.c.
| #define PG_STAT_WAL_COLS 6 |
Definition at line 35 of file pgstatfuncs.c.
| typedef enum io_stat_col io_stat_col |
| enum io_stat_col |
Definition at line 1333 of file pgstatfuncs.c.
| Datum pg_backend_pid | ( | PG_FUNCTION_ARGS | ) |
| Datum pg_stat_clear_snapshot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1867 of file pgstatfuncs.c.
References PG_RETURN_VOID, and pgstat_clear_snapshot().
| Datum pg_stat_force_next_flush | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1877 of file pgstatfuncs.c.
References PG_RETURN_VOID, and pgstat_force_next_flush().
| Datum pg_stat_get_activity | ( | PG_FUNCTION_ARGS | ) |
Definition at line 352 of file pgstatfuncs.c.
References SockAddr::addr, AuxiliaryPidGetProc(), B_BACKEND, B_BG_WORKER, B_WAL_SENDER, LocalPgBackendStatus::backend_xid, LocalPgBackendStatus::backend_xmin, BackendPidGetProc(), LocalPgBackendStatus::backendStatus, BoolGetDatum(), clean_ipv6_addr(), CStringGetDatum(), CStringGetTextDatum, DirectFunctionCall1, DirectFunctionCall3, GetBackendTypeDesc(), GetBackgroundWorkerTypeByPid(), GetLeaderApplyWorkerPid(), PgBackendGSSStatus::gss_auth, PgBackendGSSStatus::gss_delegation, PgBackendGSSStatus::gss_enc, PgBackendGSSStatus::gss_princ, HAS_PGSTAT_PERMISSIONS, inet_in(), InitMaterializedSRF(), Int32GetDatum(), INT64CONST, Int64GetDatum(), InvalidOid, InvalidPid, PGPROC::lockGroupLeader, numeric_in(), ObjectIdGetDatum(), pfree(), PG_ARGISNULL, PG_GETARG_INT32, pg_getnameinfo_all(), pg_memory_is_all_zeros(), PG_STAT_GET_ACTIVITY_COLS, pgstat_clip_activity(), pgstat_fetch_stat_numbackends(), pgstat_get_local_beentry_by_index(), pgstat_get_wait_event(), pgstat_get_wait_event_type(), PGPROC::pid, SockAddr::salen, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, PgBackendSSLStatus::ssl_bits, PgBackendSSLStatus::ssl_cipher, PgBackendSSLStatus::ssl_client_dn, PgBackendSSLStatus::ssl_client_serial, PgBackendSSLStatus::ssl_issuer_dn, PgBackendSSLStatus::ssl_version, PgBackendStatus::st_activity_raw, PgBackendStatus::st_activity_start_timestamp, PgBackendStatus::st_appname, PgBackendStatus::st_backendType, PgBackendStatus::st_clientaddr, PgBackendStatus::st_clienthostname, PgBackendStatus::st_databaseid, PgBackendStatus::st_gss, PgBackendStatus::st_gssstatus, PgBackendStatus::st_proc_start_timestamp, PgBackendStatus::st_procpid, PgBackendStatus::st_query_id, PgBackendStatus::st_ssl, PgBackendStatus::st_sslstatus, PgBackendStatus::st_state, PgBackendStatus::st_state_start_timestamp, PgBackendStatus::st_userid, PgBackendStatus::st_xact_start_timestamp, STATE_DISABLED, STATE_FASTPATH, STATE_IDLE, STATE_IDLEINTRANSACTION, STATE_IDLEINTRANSACTION_ABORTED, STATE_RUNNING, STATE_STARTING, STATE_UNDEFINED, TimestampTzGetDatum(), TransactionIdGetDatum(), TransactionIdIsValid, tuplestore_putvalues(), UINT32_ACCESS_ONCE, values, and PGPROC::wait_event_info.
| Datum pg_stat_get_archiver | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2064 of file pgstatfuncs.c.
References PgStat_ArchiverStats::archived_count, BlessTupleDesc(), CreateTemplateTupleDesc(), CStringGetTextDatum, PgStat_ArchiverStats::failed_count, heap_form_tuple(), HeapTupleGetDatum(), Int64GetDatum(), PgStat_ArchiverStats::last_archived_timestamp, PgStat_ArchiverStats::last_archived_wal, PgStat_ArchiverStats::last_failed_timestamp, PgStat_ArchiverStats::last_failed_wal, PG_RETURN_DATUM, pgstat_fetch_stat_archiver(), PgStat_ArchiverStats::stat_reset_timestamp, TimestampTzGetDatum(), TupleDescInitEntry(), and values.
| Datum pg_stat_get_backend_activity | ( | PG_FUNCTION_ARGS | ) |
Definition at line 791 of file pgstatfuncs.c.
References cstring_to_text(), HAS_PGSTAT_PERMISSIONS, pfree(), PG_GETARG_INT32, PG_RETURN_TEXT_P, pgstat_clip_activity(), pgstat_get_beentry_by_proc_number(), PgBackendStatus::st_activity_raw, and PgBackendStatus::st_userid.
| Datum pg_stat_get_backend_activity_start | ( | PG_FUNCTION_ARGS | ) |
Definition at line 859 of file pgstatfuncs.c.
References HAS_PGSTAT_PERMISSIONS, PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, pgstat_get_beentry_by_proc_number(), PgBackendStatus::st_activity_start_timestamp, and PgBackendStatus::st_userid.
| Datum pg_stat_get_backend_client_addr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 929 of file pgstatfuncs.c.
References SockAddr::addr, clean_ipv6_addr(), CStringGetDatum(), DirectFunctionCall1, HAS_PGSTAT_PERMISSIONS, inet_in(), PG_GETARG_INT32, pg_getnameinfo_all(), pg_memory_is_all_zeros(), PG_RETURN_DATUM, PG_RETURN_NULL, pgstat_get_beentry_by_proc_number(), SockAddr::salen, PgBackendStatus::st_clientaddr, and PgBackendStatus::st_userid.
| Datum pg_stat_get_backend_client_port | ( | PG_FUNCTION_ARGS | ) |
Definition at line 972 of file pgstatfuncs.c.
References SockAddr::addr, CStringGetDatum(), DirectFunctionCall1, HAS_PGSTAT_PERMISSIONS, int4in(), PG_GETARG_INT32, pg_getnameinfo_all(), pg_memory_is_all_zeros(), PG_RETURN_DATUM, PG_RETURN_INT32, PG_RETURN_NULL, pgstat_get_beentry_by_proc_number(), SockAddr::salen, PgBackendStatus::st_clientaddr, and PgBackendStatus::st_userid.
| Datum pg_stat_get_backend_dbid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 731 of file pgstatfuncs.c.
References PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_OID, pgstat_get_beentry_by_proc_number(), and PgBackendStatus::st_databaseid.
| Datum pg_stat_get_backend_idset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 225 of file pgstatfuncs.c.
References Int32GetDatum(), MemoryContextAlloc(), FuncCallContext::multi_call_memory_ctx, pgstat_fetch_stat_numbackends(), pgstat_get_local_beentry_by_index(), LocalPgBackendStatus::proc_number, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, and FuncCallContext::user_fctx.
| Datum pg_stat_get_backend_io | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1598 of file pgstatfuncs.c.
References Assert(), InitMaterializedSRF(), PgStat_Backend::io_stats, PG_GETARG_INT32, pg_stat_io_build_tuples(), pgstat_bktype_io_stats_valid(), pgstat_fetch_stat_backend_by_pid(), and PgStat_Backend::stat_reset_timestamp.
| Datum pg_stat_get_backend_pid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 718 of file pgstatfuncs.c.
References PG_GETARG_INT32, PG_RETURN_INT32, PG_RETURN_NULL, pgstat_get_beentry_by_proc_number(), and PgBackendStatus::st_procpid.
| Datum pg_stat_get_backend_start | ( | PG_FUNCTION_ARGS | ) |
Definition at line 907 of file pgstatfuncs.c.
References HAS_PGSTAT_PERMISSIONS, PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, pgstat_get_beentry_by_proc_number(), PgBackendStatus::st_proc_start_timestamp, and PgBackendStatus::st_userid.
| Datum pg_stat_get_backend_subxact | ( | PG_FUNCTION_ARGS | ) |
Definition at line 756 of file pgstatfuncs.c.
References LocalPgBackendStatus::backend_subxact_count, LocalPgBackendStatus::backend_subxact_overflowed, BlessTupleDesc(), BoolGetDatum(), CreateTemplateTupleDesc(), heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), PG_GETARG_INT32, PG_RETURN_DATUM, PG_STAT_GET_SUBXACT_COLS, pgstat_get_local_beentry_by_proc_number(), TupleDescInitEntry(), and values.
| Datum pg_stat_get_backend_userid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 744 of file pgstatfuncs.c.
References PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_OID, pgstat_get_beentry_by_proc_number(), and PgBackendStatus::st_userid.
| Datum pg_stat_get_backend_wait_event | ( | PG_FUNCTION_ARGS | ) |
Definition at line 837 of file pgstatfuncs.c.
References BackendPidGetProc(), cstring_to_text(), HAS_PGSTAT_PERMISSIONS, PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_TEXT_P, pgstat_get_beentry_by_proc_number(), pgstat_get_wait_event(), PgBackendStatus::st_procpid, PgBackendStatus::st_userid, and PGPROC::wait_event_info.
| Datum pg_stat_get_backend_wait_event_type | ( | PG_FUNCTION_ARGS | ) |
Definition at line 816 of file pgstatfuncs.c.
References BackendPidGetProc(), cstring_to_text(), HAS_PGSTAT_PERMISSIONS, PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_TEXT_P, pgstat_get_beentry_by_proc_number(), pgstat_get_wait_event_type(), PgBackendStatus::st_procpid, PgBackendStatus::st_userid, and PGPROC::wait_event_info.
| Datum pg_stat_get_backend_wal | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1695 of file pgstatfuncs.c.
References PG_GETARG_INT32, PG_RETURN_NULL, pg_stat_wal_build_tuple(), pgstat_fetch_stat_backend_by_pid(), PgStat_Backend::stat_reset_timestamp, and PgStat_Backend::wal_counters.
| Datum pg_stat_get_backend_xact_start | ( | PG_FUNCTION_ARGS | ) |
Definition at line 885 of file pgstatfuncs.c.
References HAS_PGSTAT_PERMISSIONS, PG_GETARG_INT32, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, pgstat_get_beentry_by_proc_number(), PgBackendStatus::st_userid, and PgBackendStatus::st_xact_start_timestamp.
| Datum pg_stat_get_bgwriter_buf_written_clean | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1283 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_bgwriter().
| Datum pg_stat_get_bgwriter_maxwritten_clean | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1289 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_bgwriter().
| Datum pg_stat_get_bgwriter_stat_reset_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1317 of file pgstatfuncs.c.
References PG_RETURN_TIMESTAMPTZ, and pgstat_fetch_stat_bgwriter().
| Datum pg_stat_get_buf_alloc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1323 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_bgwriter().
| Datum pg_stat_get_checkpointer_buffers_written | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1271 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_num_performed | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1247 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_num_requested | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1241 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_num_timed | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1235 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_restartpoints_performed | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1265 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_restartpoints_requested | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1259 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_restartpoints_timed | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1253 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_slru_written | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1277 of file pgstatfuncs.c.
References PG_RETURN_INT64, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_stat_reset_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1311 of file pgstatfuncs.c.
References PG_RETURN_TIMESTAMPTZ, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_sync_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1303 of file pgstatfuncs.c.
References PG_RETURN_FLOAT8, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_checkpointer_write_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1295 of file pgstatfuncs.c.
References PG_RETURN_FLOAT8, and pgstat_fetch_stat_checkpointer().
| Datum pg_stat_get_db_checksum_failures | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1164 of file pgstatfuncs.c.
References PgStat_StatDBEntry::checksum_failures, DataChecksumsEnabled(), PG_GETARG_OID, PG_RETURN_INT64, PG_RETURN_NULL, and pgstat_fetch_stat_dbentry().
| Datum pg_stat_get_db_checksum_last_failure | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1182 of file pgstatfuncs.c.
References DataChecksumsEnabled(), PgStat_StatDBEntry::last_checksum_failure, PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, and pgstat_fetch_stat_dbentry().
| Datum pg_stat_get_db_conflict_all | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1144 of file pgstatfuncs.c.
References PgStat_StatDBEntry::conflict_bufferpin, PgStat_StatDBEntry::conflict_lock, PgStat_StatDBEntry::conflict_logicalslot, PgStat_StatDBEntry::conflict_snapshot, PgStat_StatDBEntry::conflict_startup_deadlock, PgStat_StatDBEntry::conflict_tablespace, PG_GETARG_OID, PG_RETURN_INT64, and pgstat_fetch_stat_dbentry().
| Datum pg_stat_get_db_numbackends | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1016 of file pgstatfuncs.c.
References LocalPgBackendStatus::backendStatus, idx(), PG_GETARG_OID, PG_RETURN_INT32, pgstat_fetch_stat_numbackends(), pgstat_get_local_beentry_by_index(), and PgBackendStatus::st_databaseid.
| Datum pg_stat_get_db_stat_reset_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1125 of file pgstatfuncs.c.
References PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, pgstat_fetch_stat_dbentry(), and PgStat_StatDBEntry::stat_reset_timestamp.
| Datum pg_stat_get_function_calls | ( | PG_FUNCTION_ARGS | ) |
Definition at line 175 of file pgstatfuncs.c.
References PgStat_StatFuncEntry::numcalls, PG_GETARG_OID, PG_RETURN_INT64, PG_RETURN_NULL, and pgstat_fetch_stat_funcentry().
| Datum pg_stat_get_function_stat_reset_time | ( | PG_FUNCTION_ARGS | ) |
Definition at line 207 of file pgstatfuncs.c.
References PG_GETARG_OID, PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, pgstat_fetch_stat_funcentry(), and PgStat_StatFuncEntry::stat_reset_timestamp.
| Datum pg_stat_get_io | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1557 of file pgstatfuncs.c.
References Assert(), BACKEND_NUM_TYPES, InitMaterializedSRF(), pg_stat_io_build_tuples(), pgstat_bktype_io_stats_valid(), pgstat_fetch_stat_io(), pgstat_tracks_io_bktype(), PgStat_IO::stat_reset_timestamp, and PgStat_IO::stats.
| Datum pg_stat_get_progress_info | ( | PG_FUNCTION_ARGS | ) |
Definition at line 276 of file pgstatfuncs.c.
References LocalPgBackendStatus::backendStatus, ereport, errcode(), errmsg(), ERROR, HAS_PGSTAT_PERMISSIONS, i, if(), InitMaterializedSRF(), Int32GetDatum(), Int64GetDatum(), ObjectIdGetDatum(), PG_GETARG_TEXT_PP, PG_STAT_GET_PROGRESS_COLS, pg_strcasecmp(), pgstat_fetch_stat_numbackends(), pgstat_get_local_beentry_by_index(), PGSTAT_NUM_PROGRESS_PARAM, PROGRESS_COMMAND_ANALYZE, PROGRESS_COMMAND_BASEBACKUP, PROGRESS_COMMAND_CLUSTER, PROGRESS_COMMAND_COPY, PROGRESS_COMMAND_CREATE_INDEX, PROGRESS_COMMAND_VACUUM, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, PgBackendStatus::st_databaseid, PgBackendStatus::st_procpid, PgBackendStatus::st_progress_command, PgBackendStatus::st_progress_command_target, PgBackendStatus::st_progress_param, PgBackendStatus::st_userid, text_to_cstring(), tuplestore_putvalues(), and values.
| Datum pg_stat_get_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2130 of file pgstatfuncs.c.
References BlessTupleDesc(), CreateTemplateTupleDesc(), CStringGetTextDatum, heap_form_tuple(), HeapTupleGetDatum(), Int64GetDatum(), PgStat_StatReplSlotEntry::mem_exceeded_count, NameStr, namestrcpy(), PG_GETARG_TEXT_P, PG_RETURN_DATUM, PG_STAT_GET_REPLICATION_SLOT_COLS, pgstat_fetch_replslot(), PgStat_StatReplSlotEntry::slotsync_skip_at, PgStat_StatReplSlotEntry::slotsync_skip_count, PgStat_StatReplSlotEntry::spill_bytes, PgStat_StatReplSlotEntry::spill_count, PgStat_StatReplSlotEntry::spill_txns, PgStat_StatReplSlotEntry::stat_reset_timestamp, PgStat_StatReplSlotEntry::stream_bytes, PgStat_StatReplSlotEntry::stream_count, PgStat_StatReplSlotEntry::stream_txns, text_to_cstring(), TimestampTzGetDatum(), PgStat_StatReplSlotEntry::total_bytes, PgStat_StatReplSlotEntry::total_txns, TupleDescInitEntry(), and values.
| Datum pg_stat_get_slru | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1732 of file pgstatfuncs.c.
References cstring_to_text(), i, InitMaterializedSRF(), Int64GetDatum(), name, PG_STAT_GET_SLRU_COLS, pgstat_fetch_slru(), pgstat_get_slru_name(), PointerGetDatum(), ReturnSetInfo::setDesc, ReturnSetInfo::setResult, stat, TimestampTzGetDatum(), tuplestore_putvalues(), and values.
| Datum pg_stat_get_snapshot_timestamp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1852 of file pgstatfuncs.c.
References PG_RETURN_NULL, PG_RETURN_TIMESTAMPTZ, and pgstat_get_stat_snapshot_timestamp().
| Datum pg_stat_get_subscription_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2214 of file pgstatfuncs.c.
References PgStat_StatSubEntry::apply_error_count, Assert(), BlessTupleDesc(), PgStat_StatSubEntry::conflict_count, CONFLICT_NUM_TYPES, CreateTemplateTupleDesc(), heap_form_tuple(), HeapTupleGetDatum(), i, Int64GetDatum(), ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_DATUM, PG_STAT_GET_SUBSCRIPTION_STATS_COLS, pgstat_fetch_stat_subscription(), PgStat_StatSubEntry::stat_reset_timestamp, PgStat_StatSubEntry::sync_seq_error_count, PgStat_StatSubEntry::sync_table_error_count, TimestampTzGetDatum(), TupleDescInitEntry(), and values.
| Datum pg_stat_get_wal | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1717 of file pgstatfuncs.c.
References pg_stat_wal_build_tuple(), pgstat_fetch_stat_wal(), PgStat_WalStats::stat_reset_timestamp, and PgStat_WalStats::wal_counters.
| Datum pg_stat_get_xact_function_calls | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1822 of file pgstatfuncs.c.
References find_funcstat_entry(), PgStat_FunctionCounts::numcalls, PG_GETARG_OID, PG_RETURN_INT64, and PG_RETURN_NULL.
| Datum pg_stat_have_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2301 of file pgstatfuncs.c.
References PG_GETARG_INT64, PG_GETARG_OID, PG_GETARG_TEXT_P, PG_RETURN_BOOL, pgstat_get_kind_from_str(), pgstat_have_entry(), PgStat_Kind, and text_to_cstring().
|
static |
Definition at line 1460 of file pgstatfuncs.c.
References buf, PgStat_BktypeIO::bytes, PgStat_BktypeIO::counts, CStringGetDatum(), CStringGetTextDatum, DirectFunctionCall3, Float8GetDatum(), GetBackendTypeDesc(), Int32GetDatum(), INT64_FORMAT, Int64GetDatum(), IO_COL_BACKEND_TYPE, IO_COL_CONTEXT, IO_COL_INVALID, IO_COL_OBJECT, IO_COL_RESET_TIME, IO_NUM_COLUMNS, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, numeric_in(), ObjectIdGetDatum(), pg_stat_us_to_ms(), pgstat_get_io_byte_index(), pgstat_get_io_context_name(), pgstat_get_io_object_name(), pgstat_get_io_op_index(), pgstat_get_io_time_index(), pgstat_tracks_io_object(), pgstat_tracks_io_op(), ReturnSetInfo::setDesc, ReturnSetInfo::setResult, snprintf, PgStat_BktypeIO::times, TimestampTzGetDatum(), tuplestore_putvalues(), and values.
Referenced by pg_stat_get_backend_io(), and pg_stat_get_io().
| Datum pg_stat_reset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1887 of file pgstatfuncs.c.
References PG_RETURN_VOID, and pgstat_reset_counters().
| Datum pg_stat_reset_backend_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1973 of file pgstatfuncs.c.
References AuxiliaryPidGetProc(), BackendPidGetProc(), GetNumberFromPGProc, InvalidOid, PG_GETARG_INT32, PG_RETURN_VOID, pgstat_get_beentry_by_proc_number(), PGSTAT_KIND_BACKEND, pgstat_reset(), pgstat_tracks_backend_bktype(), and PgBackendStatus::st_backendType.
| Datum pg_stat_reset_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2023 of file pgstatfuncs.c.
References PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_KIND_REPLSLOT, pgstat_reset_of_kind(), pgstat_reset_replslot(), and text_to_cstring().
| Datum pg_stat_reset_shared | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1901 of file pgstatfuncs.c.
References ereport, errcode(), errhint(), errmsg(), ERROR, PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_KIND_ARCHIVER, PGSTAT_KIND_BGWRITER, PGSTAT_KIND_CHECKPOINTER, PGSTAT_KIND_IO, PGSTAT_KIND_SLRU, PGSTAT_KIND_WAL, pgstat_reset_of_kind(), text_to_cstring(), and XLogPrefetchResetStats().
| Datum pg_stat_reset_single_function_counters | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1960 of file pgstatfuncs.c.
References MyDatabaseId, PG_GETARG_OID, PG_RETURN_VOID, PGSTAT_KIND_FUNCTION, and pgstat_reset().
| Datum pg_stat_reset_single_table_counters | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1949 of file pgstatfuncs.c.
References InvalidOid, IsSharedRelation(), MyDatabaseId, PG_GETARG_OID, PG_RETURN_VOID, PGSTAT_KIND_RELATION, and pgstat_reset().
| Datum pg_stat_reset_slru | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2006 of file pgstatfuncs.c.
References PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_KIND_SLRU, pgstat_reset_of_kind(), pgstat_reset_slru(), and text_to_cstring().
| Datum pg_stat_reset_subscription_stats | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2040 of file pgstatfuncs.c.
References ereport, errcode(), errmsg(), ERROR, InvalidOid, OidIsValid, PG_ARGISNULL, PG_GETARG_OID, PG_RETURN_VOID, PGSTAT_KIND_SUBSCRIPTION, pgstat_reset(), and pgstat_reset_of_kind().
|
inlinestatic |
Definition at line 1447 of file pgstatfuncs.c.
Referenced by pg_stat_io_build_tuples().
|
static |
Definition at line 1637 of file pgstatfuncs.c.
References BlessTupleDesc(), buf, CreateTemplateTupleDesc(), CStringGetDatum(), DirectFunctionCall3, heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), Int64GetDatum(), numeric_in(), ObjectIdGetDatum(), PG_RETURN_DATUM, PG_STAT_WAL_COLS, snprintf, TimestampTzGetDatum(), TupleDescInitEntry(), UINT64_FORMAT, values, PgStat_WalCounters::wal_buffers_full, PgStat_WalCounters::wal_bytes, PgStat_WalCounters::wal_fpi, PgStat_WalCounters::wal_fpi_bytes, and PgStat_WalCounters::wal_records.
Referenced by pg_stat_get_backend_wal(), and pg_stat_get_wal().
|
static |
Definition at line 1395 of file pgstatfuncs.c.
References elog, ERROR, IO_COL_EXTEND_BYTES, IO_COL_INVALID, IO_COL_READ_BYTES, IO_COL_WRITE_BYTES, IOOP_EVICT, IOOP_EXTEND, IOOP_FSYNC, IOOP_HIT, IOOP_READ, IOOP_REUSE, IOOP_WRITE, IOOP_WRITEBACK, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().
|
static |
Definition at line 1364 of file pgstatfuncs.c.
References elog, ERROR, IO_COL_EVICTIONS, IO_COL_EXTENDS, IO_COL_FSYNCS, IO_COL_HITS, IO_COL_READS, IO_COL_REUSES, IO_COL_WRITEBACKS, IO_COL_WRITES, IOOP_EVICT, IOOP_EXTEND, IOOP_FSYNC, IOOP_HIT, IOOP_READ, IOOP_REUSE, IOOP_WRITE, IOOP_WRITEBACK, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().
|
static |
Definition at line 1422 of file pgstatfuncs.c.
References elog, ERROR, IO_COL_EXTEND_TIME, IO_COL_FSYNC_TIME, IO_COL_INVALID, IO_COL_READ_TIME, IO_COL_WRITE_TIME, IO_COL_WRITEBACK_TIME, IOOP_EVICT, IOOP_EXTEND, IOOP_FSYNC, IOOP_HIT, IOOP_READ, IOOP_REUSE, IOOP_WRITE, IOOP_WRITEBACK, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().