Catalogs: pg_available_extension_versions

The pg_available_extension_versions view lists the specific extension versions that are available for installation. See also the pg_extension catalog, which shows the extensions currently installed. Table 50-60. pg_available_extension_versions Columns Name Type Description name name Extension name version text Version name installed bool True if this version of this extension is currently installed superuser bool True if only superusers are allowed to install this extension relocatable bool T

Internals: Path of a Query

Here we give a short overview of the stages a query has to pass in order to obtain a result. A connection from an application program to the PostgreSQL server has to be established. The application program transmits a query to the server and waits to receive the results sent back by the server. The parser stage checks the query transmitted by the application program for correct syntax and creates a query tree. The rewrite system takes the query tree created by the parser stage and looks f

ALTER SERVER

NameALTER SERVER -- change the definition of a foreign server Synopsis ALTER SERVER name [ VERSION 'new_version' ] [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ] ALTER SERVER name OWNER TO { new_owner | CURRENT_USER | SESSION_USER } ALTER SERVER name RENAME TO new_name Description ALTER SERVER changes the definition of a foreign server. The first form changes the server version string or the generic options of the server (at least one clause is required). The secon

Internals//Physical Storage: Database Page Layout

This section provides an overview of the page format used within PostgreSQL tables and indexes.[1] Sequences and TOAST tables are formatted just like a regular table. In the following explanation, a byte is assumed to contain 8 bits. In addition, the term item refers to an individual data value that is stored on a page. In a table, an item is a row; in an index, an item is an index entry. Every table and index is stored as an array of pages of a fixed size (usually 8 kB, although a different pa

ORDER BY

After a query has produced an output table (after the select list has been processed) it can optionally be sorted. If sorting is not chosen, the rows will be returned in an unspecified order. The actual order in that case will depend on the scan and join plan types and the order on disk, but it must not be relied on. A particular output ordering can only be guaranteed if the sort step is explicitly chosen. The ORDER BY clause specifies the sort order: SELECT select_list FROM table_expressi

Catalogs: pg_foreign_server

The catalog pg_foreign_server stores foreign server definitions. A foreign server describes a source of external data, such as a remote server. Foreign servers are accessed via foreign-data wrappers. Table 50-24. pg_foreign_server Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly selected) srvname name Name of the foreign server srvowner oid pg_authid.oid Owner of the foreign server srvfdw oid pg_foreign_data_wrapper.oid OID of the forei

ALTER EVENT TRIGGER

NameALTER EVENT TRIGGER -- change the definition of an event trigger Synopsis ALTER EVENT TRIGGER name DISABLE ALTER EVENT TRIGGER name ENABLE [ REPLICA | ALWAYS ] ALTER EVENT TRIGGER name OWNER TO { new_owner | CURRENT_USER | SESSION_USER } ALTER EVENT TRIGGER name RENAME TO new_name Description ALTER EVENT TRIGGER changes properties of an existing event trigger. You must be superuser to alter an event trigger. Parameters name The name of an existing trigger to alter. new_owner

Indexes and Collations

An index can support only one collation per index column. If multiple collations are of interest, multiple indexes may be needed. Consider these statements: CREATE TABLE test1c ( id integer, content varchar COLLATE "x" ); CREATE INDEX test1c_content_index ON test1c (content); The index automatically uses the collation of the underlying column. So a query of the form SELECT * FROM test1c WHERE content > constant; could use the index, because the comparison will by default use the

When Can Parallel Query Be Used?

There are several settings which can cause the query planner not to generate a parallel query plan under any circumstances. In order for any parallel query plans whatsoever to be generated, the following settings must be configured as indicated. max_parallel_workers_per_gather must be set to a value which is greater than zero. This is a special case of the more general principle that no more workers should be used than the number configured via max_parallel_workers_per_gather. dynamic_shar

btree_gist

btree_gist provides GiST index operator classes that implement B-tree equivalent behavior for the data types int2, int4, int8, float4, float8, numeric, timestamp with time zone, timestamp without time zone, time with time zone, time without time zone, date, interval, oid, money, char, varchar, text, bytea, bit, varbit, macaddr, inet, and cidr. In general, these operator classes will not outperform the equivalent standard B-tree index methods, and they lack one major feature of the standard B-tr