System Administration Functions
The functions described in this section are used to control and monitor a ProtonBase installation.
Configuration Settings Functions
Table 8.67 shows the functions available to query and alter run-time configuration parameters.
Table Configuration Settings Functions
| Function Description Example(s) |
|---|
Returns the current value of the setting
|
Sets the parameter
|
Server Signaling Functions
The functions shown in Table 8.68 send control signals to other server processes. Use of these functions is restricted to superusers by default but access may be granted to others using GRANT, with noted exceptions.
Each of these functions returns true if the signal was successfully sent and false if sending the signal failed.
Table Server Signaling Functions
| Function Description |
|---|
Cancels the current query of the session whose backend process has the specified process ID. This is also allowed if the calling role is a member of the role whose backend is being canceled or the calling role has been granted |
Terminates the session whose backend process has the specified process ID. This is also allowed if the calling role is a member of the role whose backend is being terminated or the calling role has been granted If |
pg_cancel_backend and pg_terminate_backend send signals (SIGINT or SIGTERM respectively) to backend processes identified by process ID. The process ID of an active backend can be found from the pid column of the pg_stat_activity view, or by listing the postgres processes on the server (using ps on Unix or the Task Manager on Windows). The role of an active backend can be found from the usename column of the pg_stat_activity view.
Database Object Size Functions
The functions shown in Table 8.69 calculate the on-disk size of database objects.
Table Database Object Size Functions
| Function Description Example(s) |
|---|
Returns the total disk space used by the database with the specified name or OID. To use this function, you must have
|
Returns the disk space used by the specified table, excluding indexes (but including TOAST, free space map, and visibility map). The table can be specified by name or by OID.
|
Returns the on-disk size in bytes of one fork of the specified relation. The relation can be a table or an index, and is specified by name or by OID. The fork can be specified by name (
|
The functions shown in this table operate on database objects. To get the size of a table including indexes and TOAST data, use pg_total_relation_size. To format the result in a human-readable format, use pg_size_pretty.