PostgreSQL User Account

As with any server daemon that is accessible to the outside world, it is advisable to run PostgreSQL under a separate user account. This user account should only own the data that is managed by the server, and should not be shared with other daemons. (For example, using the user nobody is a bad idea.) It is not advisable to install executables owned by this user because compromised systems could then modify their own binaries. To add a Unix user account to your system, look for a command userad

postgres_fdw

The postgres_fdw module provides the foreign-data wrapper postgres_fdw, which can be used to access data stored in external PostgreSQL servers. The functionality provided by this module overlaps substantially with the functionality of the older dblink module. But postgres_fdw provides more transparent and standards-compliant syntax for accessing remote tables, and can give better performance in many cases. To prepare for remote access using postgres_fdw: Install the postgres_fdw extension usin

postgres

Namepostgres -- PostgreSQL database server Synopsis postgres [option...] Description postgres is the PostgreSQL database server. In order for a client application to access a database it connects (over a network or locally) to a running postgres instance. The postgres instance then starts a separate server process to handle the connection. One postgres instance always manages the data of exactly one database cluster. A database cluster is a collection of databases that is stored at a co

PostgreSQL Error Codes

All messages emitted by the PostgreSQL server are assigned five-character error codes that follow the SQL standard's conventions for "SQLSTATE" codes. Applications that need to know which error condition has occurred should usually test the error code, rather than looking at the textual error message. The error codes are less likely to change across PostgreSQL releases, and also are not subject to change due to localization of error messages. Note that some, but not all, of the error codes prod

pg_visibility

The pg_visibility module provides a means for examining the visibility map (VM) and page-level visibility information. It also provides functions to check the integrity of the visibility map and to force it to be rebuilt. Three different bits are used to store information about page-level visibility. The all-visible bit in the visibility map indicates that every tuple on a given page of a relation is visible to every current transaction. The all-frozen bit in the visibility map indicates that e

pg_xlogdump

Namepg_xlogdump -- display a human-readable rendering of the write-ahead log of a PostgreSQL database cluster Synopsis pg_xlogdump [option...] [startseg [endseg] ] Description pg_xlogdump displays the write-ahead log (WAL) and is mainly useful for debugging or educational purposes. This utility can only be run by the user who installed the server, because it requires read-only access to the data directory. Options The following command-line options control the location and format of

pg_upgrade

Namepg_upgrade -- upgrade a PostgreSQL server instance Synopsis pg_upgrade -b oldbindir -B newbindir -d olddatadir -D newdatadir [option...] Description pg_upgrade (formerly called pg_migrator) allows data stored in PostgreSQL data files to be upgraded to a later PostgreSQL major version without the data dump/reload typically required for major version upgrades, e.g. from 8.4.7 to the current major release of PostgreSQL. It is not required for minor version upgrades, e.g. from 9.0.1 to

pg_trgm

The pg_trgm module provides functions and operators for determining the similarity of alphanumeric text based on trigram matching, as well as index operator classes that support fast searching for similar strings. F.31.1. Trigram (or Trigraph) Concepts A trigram is a group of three consecutive characters taken from a string. We can measure the similarity of two strings by counting the number of trigrams they share. This simple idea turns out to be very effective for measuring the similarity of

pg_stat_statements

The pg_stat_statements module provides a means for tracking execution statistics of all SQL statements executed by a server. The module must be loaded by adding pg_stat_statements to shared_preload_libraries in postgresql.conf, because it requires additional shared memory. This means that a server restart is needed to add or remove the module. When pg_stat_statements is loaded, it tracks statistics across all databases of the server. To access and manipulate these statistics, the module provide

pg_rewind

Namepg_rewind -- synchronize a PostgreSQL data directory with another data directory that was forked from it Synopsis pg_rewind [option...] {-D | --target-pgdata} directory {--source-pgdata=directory | --source-server=connstr} Description pg_rewind is a tool for synchronizing a PostgreSQL cluster with another copy of the same cluster, after the clusters' timelines have diverged. A typical scenario is to bring an old master server back online after failover as a standby that follows the