Instance, Network & Connection Management

Postgresql Catalog

This topic contains useful information about how to debug when queries are slow andthe app freezes frequently. Metadata of schema objects like table, column, index, etc. and statistics collected inthe system are stored in tables and views in the pg_catalog schema. Tables in the pg_catalog schema are modified by the users indirectly.For example, when a Postgresql Catalog

Process Monitoring

Postgres backend processes can be monitored with the C/C++ debugging tool “rr”(record & replay) in Linux operating systems.Postgres must be installed with the debugger option (details are available in theinstallation steps from the enable-debug source code). Can be terminated with CTRL C or you can end with pg_ctl -D /pg/data/13.6/ -l pg.log stop Logs are Process Monitoring

Examining the Log File

log_destination supports stderr, syslog and csv methods. Logs in CSV format canbe imported into the analysis software log_rotation_age determines the maximum time the log file will be written. When thetime is up, it creates a new file. If it is set without a unit, it is set for minutes.(Enabled when logging_collector = on.)Example: log_rotation_age = Examining the Log File

Network Settings

listen_addresses : Default is localhost (127.0.0.1). Since Postgres only listenson localhost, it only allows local connections. It does not allow connections over thenetwork. A restart is required after the change.The IPs you want to be accessed must be open for listening. port : The default value is 5432. A restart is required for a change. Network Settings

Starting and Stopping Postgresql Instance

Starting Postgresql Instance If installed from pre-built packages (yum/apt install postgresql…), services arecreated according to the operating system. Thus, it can be stopped and started withsystemctl commands and its startup can be automated (systemctl enablepostgres). Note: In the appendix chapters, where the installation and architecture from the prebuiltpackage were explained, and in the first chapter, Starting and Stopping Postgresql Instance

Parameters and Values

All parameter names are case sensitive.Below are the data types taken by the parameters:Boolean: A data type that can take the values on, off, true, false, yes, no, 1, 0.String: Text data type.Numeric: Numeric data type that can be defined as digits.Numeric with Unit: Like B, kB, 32MB, 16GB, TB, us, ms, s, min, h, Parameters and Values

Opening Parameter File

When the instance is started, it first reads the configuration file and opens the instanceaccording to the values set in the parameters. postgresql.conf: When the cluster is created (initdb), it is created in the data folder bydefault.Text is a file.The file directory may differ depending on the version.In systems such as Enterprise Linux (OEL, RHEL, Opening Parameter File