Date/Time Functions and Operators

Table 9-30 shows the available functions for date/time value processing, with details appearing in the following subsections. Table 9-29 illustrates the behaviors of the basic arithmetic operators (+, *, etc.). For formatting functions, refer to Section 9.8. You should be familiar with the background information on date/time data types from Section 8.5. All the functions and operators described below that take time or timestamp inputs actually come in two variants: one that takes time with time

Catalogs: pg_opfamily

The catalog pg_opfamily defines operator families. Each operator family is a collection of operators and associated support routines that implement the semantics specified for a particular index access method. Furthermore, the operators in a family are all "compatible", in a way that is specified by the access method. The operator family concept allows cross-data-type operators to be used with indexes and to be reasoned about using knowledge of access method semantics. Operator families are des

DROP TEXT SEARCH TEMPLATE

NameDROP TEXT SEARCH TEMPLATE -- remove a text search template Synopsis DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] name [ CASCADE | RESTRICT ] Description DROP TEXT SEARCH TEMPLATE drops an existing text search template. You must be a superuser to use this command. Parameters IF EXISTS Do not throw an error if the text search template does not exist. A notice is issued in this case. name The name (optionally schema-qualified) of an existing text search template. CASCADE Automati

pg_lsn Type

The pg_lsn data type can be used to store LSN (Log Sequence Number) data which is a pointer to a location in the XLOG. This type is a representation of XLogRecPtr and an internal system type of PostgreSQL. Internally, an LSN is a 64-bit integer, representing a byte position in the write-ahead log stream. It is printed as two hexadecimal numbers of up to 8 digits each, separated by a slash; for example, 16/B374D848. The pg_lsn type supports the standard comparison operators, like = and >. Two

pgcrypto

The pgcrypto module provides cryptographic functions for PostgreSQL. F.25.1. General Hashing Functions F.25.1.1. digest() digest(data text, type text) returns bytea digest(data bytea, type text) returns bytea Computes a binary hash of the given data. type is the algorithm to use. Standard algorithms are md5, sha1, sha224, sha256, sha384 and sha512. If pgcrypto was built with OpenSSL, more algorithms are available, as detailed in Table F-20. If you want the digest as a hexadecimal string, u

Numeric Types

Numeric types consist of two-, four-, and eight-byte integers, four- and eight-byte floating-point numbers, and selectable-precision decimals. Table 8-2 lists the available types. Table 8-2. Numeric Types Name Storage Size Description Range smallint 2 bytes small-range integer -32768 to +32767 integer 4 bytes typical choice for integer -2147483648 to +2147483647 bigint 8 bytes large-range integer -9223372036854775808 to +9223372036854775807 decimal variable user-specified precision, exact up

DROP MATERIALIZED VIEW

NameDROP MATERIALIZED VIEW -- remove a materialized view Synopsis DROP MATERIALIZED VIEW [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] Description DROP MATERIALIZED VIEW drops an existing materialized view. To execute this command you must be the owner of the materialized view. Parameters IF EXISTS Do not throw an error if the materialized view does not exist. A notice is issued in this case. name The name (optionally schema-qualified) of the materialized view to remove. C

PREPARE

NamePREPARE -- prepare a statement for execution Synopsis PREPARE name [ ( data_type [, ...] ) ] AS statement Description PREPARE creates a prepared statement. A prepared statement is a server-side object that can be used to optimize performance. When the PREPARE statement is executed, the specified statement is parsed, analyzed, and rewritten. When an EXECUTE command is subsequently issued, the prepared statement is planned and executed. This division of labor avoids repetitive parse

Catalogs: pg_shdescription

The catalog pg_shdescription stores optional descriptions (comments) for shared database objects. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. See also pg_description, which performs a similar function for descriptions involving objects within a single database. Unlike most system catalogs, pg_shdescription is shared across all databases of a cluster: there is only one copy of pg_shdescription per cluster, not one per database. Table 50-44. pg_s

Catalogs: pg_extension

The catalog pg_extension stores information about the installed extensions. See Section 36.15 for details about extensions. Table 50-22. pg_extension Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly selected) extname name Name of the extension extowner oid pg_authid.oid Owner of the extension extnamespace oid pg_namespace.oid Schema containing the extension's exported objects extrelocatable bool True if extension can be relocated to a