postgres

package
v0.41.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2021 License: BSD-2-Clause, BSD-3-Clause, PostgreSQL Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const QueryMarkerSQL string = "/* pganalyze-collector */ "

Variables

This section is empty.

Functions

func CollectAllSchemas

func CollectAllSchemas(server *state.Server, collectionOpts state.CollectionOpts, logger *util.Logger, ps state.PersistedState, ts state.TransientState, systemType string) (state.PersistedState, state.TransientState)

func CurrentDatabaseName

func CurrentDatabaseName(db *sql.DB) (result string, err error)

CurrentDatabaseName - Get name of the database we're currently connected to

func CurrentDatabaseOid

func CurrentDatabaseOid(db *sql.DB) (result state.Oid, err error)

CurrentDatabaseOid - Find OID of the database we're currently connected to

func EstablishConnection

func EstablishConnection(server *state.Server, logger *util.Logger, globalCollectionOpts state.CollectionOpts, databaseName string) (connection *sql.DB, err error)

func GetBackendCounts

func GetBackendCounts(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion, systemType string) ([]state.PostgresBackendCount, error)

func GetBackends

func GetBackends(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion, systemType string) ([]state.PostgresBackend, error)

func GetBloatStats

func GetBloatStats(logger *util.Logger, db *sql.DB, systemType, ignoreRegexp string) (report state.PostgresBloatStats, err error)

func GetBuffercache

func GetBuffercache(logger *util.Logger, db *sql.DB, systemType, ignoreRegexp string) (report state.PostgresBuffercache, err error)

func GetColumnStats added in v0.41.0

func GetColumnStats(logger *util.Logger, db *sql.DB, globalCollectionOpts state.CollectionOpts, systemType string) (columnStats state.PostgresColumnStatsMap, err error)

func GetDatabases

func GetDatabases(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion) ([]state.PostgresDatabase, error)

func GetFunctionStats

func GetFunctionStats(db *sql.DB, postgresVersion state.PostgresVersion, ignoreRegexp string) (functionStats state.PostgresFunctionStatsMap, err error)

func GetFunctions

func GetFunctions(db *sql.DB, postgresVersion state.PostgresVersion, currentDatabaseOid state.Oid, ignoreRegexp string) ([]state.PostgresFunction, error)

func GetIndexBloat

func GetIndexBloat(logger *util.Logger, db *sql.DB, columnStatsSourceTable, ignoreRegexp string) (indexBloat []state.PostgresIndexBloat, err error)

func GetIndexStats

func GetIndexStats(db *sql.DB, postgresVersion state.PostgresVersion, ignoreRegexp string) (indexStats state.PostgresIndexStatsMap, err error)

func GetIsAwsAurora

func GetIsAwsAurora(db *sql.DB) (bool, error)

func GetIsReplica

func GetIsReplica(logger *util.Logger, db *sql.DB) (bool, error)

func GetPostgresSetting

func GetPostgresSetting(settingName string, server *state.Server, globalCollectionOpts state.CollectionOpts, prefixedLogger *util.Logger) (string, error)

func GetPostgresVersion

func GetPostgresVersion(logger *util.Logger, db *sql.DB) (version state.PostgresVersion, err error)

GetPostgresVersion - Reads the version of the connected PostgreSQL server

func GetRelationBloat

func GetRelationBloat(logger *util.Logger, db *sql.DB, columnStatsSourceTable string, ignoreRegexp string) (relBloat []state.PostgresRelationBloat, err error)

func GetRelationStats

func GetRelationStats(db *sql.DB, postgresVersion state.PostgresVersion, ignoreRegexp string) (relStats state.PostgresRelationStatsMap, err error)

func GetRelations

func GetRelations(db *sql.DB, postgresVersion state.PostgresVersion, currentDatabaseOid state.Oid, ignoreRegexp string) ([]state.PostgresRelation, error)

func GetReplication

func GetReplication(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion, systemType string) (state.PostgresReplication, error)

func GetRoles

func GetRoles(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion) ([]state.PostgresRole, error)

func GetSequenceReport

func GetSequenceReport(logger *util.Logger, db *sql.DB) (report state.PostgresSequenceReport, err error)

func GetSettings

func GetSettings(db *sql.DB) ([]state.PostgresSetting, error)

func GetStatements

func GetStatements(server *state.Server, logger *util.Logger, db *sql.DB, globalCollectionOpts state.CollectionOpts, postgresVersion state.PostgresVersion, showtext bool, systemType string) (state.PostgresStatementMap, state.PostgresStatementTextMap, state.PostgresStatementStatsMap, error)

func GetTypes added in v0.41.0

func GetTypes(db *sql.DB, postgresVersion state.PostgresVersion, currentDatabaseOid state.Oid) ([]state.PostgresType, error)

func GetVacuumProgress

func GetVacuumProgress(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion, ignoreRegexp string) ([]state.PostgresVacuumProgress, error)

func GetVacuumStats

func GetVacuumStats(logger *util.Logger, db *sql.DB, ignoreRegexp string) (report state.PostgresVacuumStats, err error)

func ResetStatements

func ResetStatements(logger *util.Logger, db *sql.DB, systemType string) error

func RunExplain

func RunExplain(server *state.Server, inputs []state.PostgresQuerySample, collectionOpts state.CollectionOpts, logger *util.Logger) (outputs []state.PostgresQuerySample)

func SetDefaultStatementTimeout

func SetDefaultStatementTimeout(connection *sql.DB, logger *util.Logger, server *state.Server)

func SetQueryTextStatementTimeout

func SetQueryTextStatementTimeout(connection *sql.DB, logger *util.Logger, server *state.Server)

func SetStatementTimeout

func SetStatementTimeout(connection *sql.DB, statementTimeoutMs int32)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL