Catalogs: pg_description

The catalog pg_description stores optional descriptions (comments) for each database object. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. Descriptions of many built-in system objects are provided in the initial contents of pg_description. See also pg_shdescription, which performs a similar function for descriptions involving objects that are shared across a database cluster. Table 50-19. pg_description Columns Name Type References Description ob

Default Roles

PostgreSQL provides a set of default roles which provide access to certain, commonly needed, privileged capabilities and information. Administrators can GRANT these roles to users and/or other roles in their environment, providing those users with access to the specified capabilities and information. The default roles are described in Table 21-1. Note that the specific permissions for each of the default roles may change in the future as additional capabilities are added. Administrators should

Indexes on Expressions

An index column need not be just a column of the underlying table, but can be a function or scalar expression computed from one or more columns of the table. This feature is useful to obtain fast access to tables based on the results of computations. For example, a common way to do case-insensitive comparisons is to use the lower function: SELECT * FROM test1 WHERE lower(col1) = 'value'; This query can use an index if one has been defined on the result of the lower(col1) function: CREATE IND

Internals//Genetic Query Optimizer: Further Reading

The following resources contain additional information about genetic algorithms: The Hitch-Hiker's Guide to Evolutionary Computation, (FAQ for news://comp.ai.genetic) Evolutionary Computation and its application to art and design, by Craig Reynolds Fundamentals of Database Systems The design and implementation of the POSTGRES query optimizer Prev Next Genetic Query Optimization (GEQO) in PostgreSQL Up Index Access Method Interface Definition

Catalogs: pg_seclabels

The view pg_seclabels provides information about security labels. It as an easier-to-query version of the pg_seclabel catalog. Table 50-75. pg_seclabels Columns Name Type References Description objoid oid any OID column The OID of the object this security label pertains to classoid oid pg_class.oid The OID of the system catalog this object appears in objsubid int4 For a security label on a table column, this is the column number (the objoid and classoid refer to the table itself). For all o

Catalogs: pg_namespace

The catalog pg_namespace stores namespaces. A namespace is the structure underlying SQL schemas: each namespace can have a separate collection of relations, types, etc. without name conflicts. Table 50-32. pg_namespace Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly selected) nspname name Name of the namespace nspowner oid pg_authid.oid Owner of the namespace nspacl aclitem[] Access privileges; see GRANT and REVOKE for details Pre

Log File Maintenance

It is a good idea to save the database server's log output somewhere, rather than just discarding it via /dev/null. The log output is invaluable when diagnosing problems. However, the log output tends to be voluminous (especially at higher debug levels) so you won't want to save it indefinitely. You need to rotate the log files so that new log files are started and old ones removed after a reasonable period of time. If you simply direct the stderr of postgres into a file, you will have log outp

Server Configuration: Error Handling

exit_on_error (boolean) If true, any error will terminate the current session. By default, this is set to false, so that only FATAL errors will terminate the session. restart_after_crash (boolean) When set to true, which is the default, PostgreSQL will automatically reinitialize after a backend crash. Leaving this value set to true is normally the best way to maximize the availability of the database. However, in some circumstances, such as when PostgreSQL is being invoked by clusterware,

Managing Kernel Resources

PostgreSQL can sometimes exhaust various operating system resource limits, especially when multiple copies of the server are running on the same system, or in very large installations. This section explains the kernel resources used by PostgreSQL and the steps you can take to resolve problems related to kernel resource consumption. 18.4.1. Shared Memory and Semaphores Shared memory and semaphores are collectively referred to as "System V IPC" (together with message queues, which are not releva

Catalogs: pg_database

The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Consult Chapter 22 for details about the meaning of some of the parameters. Unlike most system catalogs, pg_database is shared across all databases of a cluster: there is only one copy of pg_database per cluster, not one per database. Table 50-15. pg_database Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly sel