Catalogs: pg_config

The view pg_config describes the compile-time configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries. It provides the same basic information as the pg_config PostgreSQL client application. By default, the pg_config view can be read only by superusers. Table 50-61. pg_config Columns Name Type Description name text Th

Shutting Down the Server

There are several ways to shut down the database server. You control the type of shutdown by sending different signals to the master postgres process. SIGTERM This is the Smart Shutdown mode. After receiving SIGTERM, the server disallows new connections, but lets existing sessions end their work normally. It shuts down only after all of the sessions terminate. If the server is in online backup mode, it additionally waits until online backup mode is no longer active. While backup mode is activ

DROP ROLE

NameDROP ROLE -- remove a database role Synopsis DROP ROLE [ IF EXISTS ] name [, ...] Description DROP ROLE removes the specified role(s). To drop a superuser role, you must be a superuser yourself; to drop non-superuser roles, you must have CREATEROLE privilege. A role cannot be removed if it is still referenced in any database of the cluster; an error will be raised if so. Before dropping the role, you must drop all the objects it owns (or reassign their ownership) and revoke any pr

Routine Reindexing

In some situations it is worthwhile to rebuild indexes periodically with the REINDEX command or a series of individual rebuilding steps. B-tree index pages that have become completely empty are reclaimed for re-use. However, there is still a possibility of inefficient use of space: if all but a few index keys on a page have been deleted, the page remains allocated. Therefore, a usage pattern in which most, but not all, keys in each range are eventually deleted will see poor use of space. For su

sslinfo

The sslinfo module provides information about the SSL certificate that the current client provided when connecting to PostgreSQL. The module is useless (most functions will return NULL) if the current connection does not use SSL. This extension won't build at all unless the installation was configured with --with-openssl. F.37.1. Functions Provided ssl_is_used() returns boolean Returns TRUE if current connection to server uses SSL, and FALSE otherwise. ssl_version() returns

auth_delay

auth_delay causes the server to pause briefly before reporting authentication failure, to make brute-force attacks on database passwords more difficult. Note that it does nothing to prevent denial-of-service attacks, and may even exacerbate them, since processes that are waiting before reporting authentication failure will still consume connection slots. In order to function, this module must be loaded via shared_preload_libraries in postgresql.conf. F.2.1. Configuration Parameters auth_dela

Catalogs: pg_settings

The view pg_settings provides access to run-time parameters of the server. It is essentially an alternative interface to the SHOW and SET commands. It also provides access to some facts about each parameter that are not directly available from SHOW, such as minimum and maximum values. Table 50-76. pg_settings Columns Name Type Description name text Run-time configuration parameter name setting text Current value of the parameter unit text Implicit unit of the parameter category text Logical g

ALTER SYSTEM

NameALTER SYSTEM -- change a server configuration parameter Synopsis ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT } ALTER SYSTEM RESET configuration_parameter ALTER SYSTEM RESET ALL Description ALTER SYSTEM is used for changing server configuration parameters across the entire database cluster. It can be more convenient than the traditional method of manually editing the postgresql.conf file. ALTER SYSTEM writes the given parameter setting to the po

ALTER SCHEMA

NameALTER SCHEMA -- change the definition of a schema Synopsis ALTER SCHEMA name RENAME TO new_name ALTER SCHEMA name OWNER TO { new_owner | CURRENT_USER | SESSION_USER } Description ALTER SCHEMA changes the definition of a schema. You must own the schema to use ALTER SCHEMA. To rename a schema you must also have the CREATE privilege for the database. To alter the owner, you must also be a direct or indirect member of the new owning role, and you must have the CREATE privilege for the

ALTER OPERATOR

NameALTER OPERATOR -- change the definition of an operator Synopsis ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } ) OWNER TO { new_owner | CURRENT_USER | SESSION_USER } ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } ) SET SCHEMA new_schema ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } ) SET ( { RESTRICT = { res_proc | NONE } | JOIN = { join_proc | NONE } } [, ... ] ) Description ALTER OPER