pg_config

Namepg_config -- retrieve information about the installed version of PostgreSQL Synopsis pg_config [option...] Description The pg_config utility prints configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries. Options To use pg_config, supply one or more of the following options: --bindir Print the location

ANALYZE

NameANALYZE -- collect statistics about a database Synopsis ANALYZE [ VERBOSE ] [ table_name [ ( column_name [, ...] ) ] ] Description ANALYZE collects statistics about the contents of tables in the database, and stores the results in the pg_statistic system catalog. Subsequently, the query planner uses these statistics to help determine the most efficient execution plans for queries. With no parameter, ANALYZE examines every table in the current database. With a parameter, ANALYZE ex

Secure TCP/IP Connections with SSL

PostgreSQL has native support for using SSL connections to encrypt client/server communications for increased security. This requires that OpenSSL is installed on both client and server systems and that support in PostgreSQL is enabled at build time (see Chapter 16). With SSL support compiled in, the PostgreSQL server can be started with SSL enabled by setting the parameter ssl to on in postgresql.conf. The server will listen for both normal and SSL connections on the same TCP port, and will ne

dropuser

Namedropuser -- remove a PostgreSQL user account Synopsis dropuser [connection-option...] [option...] [username] Description dropuser removes an existing PostgreSQL user. Only superusers and users with the CREATEROLE privilege can remove PostgreSQL users. (To remove a superuser, you must yourself be a superuser.) dropuser is a wrapper around the SQL command DROP ROLE. There is no effective difference between dropping users via this utility and via other methods for accessing the server.

SQL Dump

The idea behind this dump method is to generate a file with SQL commands that, when fed back to the server, will recreate the database in the same state as it was at the time of the dump. PostgreSQL provides the utility program pg_dump for this purpose. The basic usage of this command is: pg_dump dbname > outfile As you see, pg_dump writes its result to the standard output. We will see below how this can be useful. While the above command creates a text file, pg_dump can create files in ot

Binary Data Types

The bytea data type allows storage of binary strings; see Table 8-6. Table 8-6. Binary Data Types Name Storage Size Description bytea 1 or 4 bytes plus the actual binary string variable-length binary string A binary string is a sequence of octets (or bytes). Binary strings are distinguished from character strings in two ways. First, binary strings specifically allow storing octets of value zero and other "non-printable" octets (usually, octets outside the range 32 to 126). Character strings

Character Set Support

The character set support in PostgreSQL allows you to store text in a variety of character sets (also called encodings), including single-byte character sets such as the ISO 8859 series and multiple-byte character sets such as EUC (Extended Unix Code), UTF-8, and Mule internal code. All supported character sets can be used transparently by clients, but a few are not supported for use within the server (that is, as a server-side encoding). The default character set is selected while initializing

Binary String Functions and Operators

This section describes functions and operators for examining and manipulating values of type bytea. SQL defines some string functions that use key words, rather than commas, to separate arguments. Details are in Table 9-11. PostgreSQL also provides versions of these functions that use the regular function invocation syntax (see Table 9-12). Note: The sample results shown on this page assume that the server parameter bytea_output is set to escape (the traditional PostgreSQL format). Table 9-

Internals//Index Access Method: Index Access Method Functions

The index construction and maintenance functions that an index access method must provide in IndexAmRoutine are: IndexBuildResult * ambuild (Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo); Build a new index. The index relation has been physically created, but is empty. It must be filled in with whatever fixed data the access method requires, plus entries for all tuples already existing in the table. Ordinarily the ambuild function will call IndexBuildHe

Type Conversion: Operators

The specific operator that is referenced by an operator expression is determined using the following procedure. Note that this procedure is indirectly affected by the precedence of the operators involved, since that will determine which sub-expressions are taken to be the inputs of which operators. See Section 4.1.6 for more information. Operator Type Resolution Select the operators to be considered from the pg_operator system catalog. If a non-schema-qualified operator name was used (the us