Catalogs: pg_foreign_data_wrapper

The catalog pg_foreign_data_wrapper stores foreign-data wrapper definitions. A foreign-data wrapper is the mechanism by which external data, residing on foreign servers, is accessed. Table 50-23. pg_foreign_data_wrapper Columns Name Type References Description oid oid Row identifier (hidden attribute; must be explicitly selected) fdwname name Name of the foreign-data wrapper fdwowner oid pg_authid.oid Owner of the foreign-data wrapper fdwhandler oid pg_proc.oid References a handler functi

Index Types

PostgreSQL provides several index types: B-tree, Hash, GiST, SP-GiST, GIN and BRIN. Each index type uses a different algorithm that is best suited to different types of queries. By default, the CREATE INDEX command creates B-tree indexes, which fit the most common situations. B-trees can handle equality and range queries on data that can be sorted into some ordering. In particular, the PostgreSQL query planner will consider using a B-tree index whenever an indexed column is involved in a compar

pg_test_timing

Namepg_test_timing -- measure timing overhead Synopsis pg_test_timing [option...] Description pg_test_timing is a tool to measure the timing overhead on your system and confirm that the system time never moves backwards. Systems that are slow to collect timing data can give less accurate EXPLAIN ANALYZE results. Options pg_test_timing accepts the following command-line options: -d duration--duration=duration Specifies the test duration, in seconds. Longer durations give slightly

Internals//GiST Indexes: Built-in Operator Classes

The core PostgreSQL distribution includes the GiST operator classes shown in Table 61-1. (Some of the optional modules described in Appendix F provide additional GiST operator classes.) Table 61-1. Built-in GiST Operator Classes Name Indexed Data Type Indexable Operators Ordering Operators box_ops box && &> &< &<| >> << <<| <@ @> @ |&> |>> ~ ~= circle_ops circle && &> &< &<| >> << &

btree_gin

btree_gin provides sample GIN operator classes that implement B-tree equivalent behavior for the data types int2, int4, int8, float4, float8, 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-tree code:

intarray

The intarray module provides a number of useful functions and operators for manipulating null-free arrays of integers. There is also support for indexed searches using some of the operators. All of these operations will throw an error if a supplied array contains any NULL elements. Many of these operations are only sensible for one-dimensional arrays. Although they will accept input arrays of more dimensions, the data is treated as though it were a linear array in storage order. F.18.1. intarr

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

Performance Tips: Populating a Database

One might need to insert a large amount of data when first populating a database. This section contains some suggestions on how to make this process as efficient as possible. 14.4.1. Disable Autocommit When using multiple INSERTs, turn off autocommit and just do one commit at the end. (In plain SQL, this means issuing BEGIN at the start and COMMIT at the end. Some client libraries might do this behind your back, in which case you need to make sure the library does it when you want it done.) If

Authentication Problems

Authentication failures and related problems generally manifest themselves through error messages like the following: FATAL: no pg_hba.conf entry for host "123.123.123.123", user "andym", database "testdb" This is what you are most likely to get if you succeed in contacting the server, but it does not want to talk to you. As the message suggests, the server refused the connection request because it found no matching entry in its pg_hba.conf configuration file. FATAL: password authenticatio

ROLLBACK PREPARED

NameROLLBACK PREPARED -- cancel a transaction that was earlier prepared for two-phase commit Synopsis ROLLBACK PREPARED transaction_id Description ROLLBACK PREPARED rolls back a transaction that is in prepared state. Parameters transaction_id The transaction identifier of the transaction that is to be rolled back. Notes To roll back a prepared transaction, you must be either the same user that executed the transaction originally, or a superuser. But you do not have to be in