PostgreSQL 7.1 Reference Manual

The PostgreSQL Global Development Group


Table of Contents
I. SQL Commands
ABORT — Aborts the current transaction
ALTER GROUP — Add users to a group, remove users from a group
ALTER TABLE — Modifies table properties
ALTER USER — Modifies user account information
BEGIN — Begins a transaction in chained mode
CHECKPOINT — Force transaction log checkpoint
CLOSE — Close a cursor
CLUSTER — Gives storage clustering advice to the server
COMMENT — Add comment to an object
COMMIT — Commits the current transaction
COPY — Copies data between files and tables
CREATE AGGREGATE — Defines a new aggregate function
CREATE CONSTRAINT TRIGGER — Create a trigger to support a constraint
CREATE DATABASE — Creates a new database
CREATE FUNCTION — Defines a new function
CREATE GROUP — Creates a new group
CREATE INDEX — Constructs a secondary index
CREATE LANGUAGE — Defines a new language for functions
CREATE OPERATOR — Defines a new user operator
CREATE RULE — Defines a new rule
CREATE SEQUENCE — Creates a new sequence number generator
CREATE TABLE — Creates a new table
CREATE TABLE AS — Creates a new table from the results of a SELECT
CREATE TRIGGER — Creates a new trigger
CREATE TYPE — Defines a new base data type
CREATE USER — Creates a new database user
CREATE VIEW — Constructs a virtual table
DECLARE — Defines a cursor for table access
DELETE — Removes rows from a table
DROP AGGREGATE — Removes the definition of an aggregate function
DROP DATABASE — Removes an existing database
DROP FUNCTION — Removes a user-defined C function
DROP GROUP — Removes a group
DROP INDEX — Removes existing indexes from a database
DROP LANGUAGE — Removes a user-defined procedural language
DROP OPERATOR — Removes an operator from the database
DROP RULE — Removes existing rules from the database
DROP SEQUENCE — Removes existing sequences from a database
DROP TABLE — Removes existing tables from a database
DROP TRIGGER — Removes the definition of a trigger
DROP TYPE — Removes user-defined types from the system catalogs
DROP USER — Removes a user
DROP VIEW — Removes existing views from a database
END — Commits the current transaction
EXPLAIN — Shows statement execution plan
FETCH — Gets rows using a cursor
GRANT — Grants access privilege to a user, a group or all users
INSERT — Inserts new rows into a table
LISTEN — Listen for a response on a notify condition
LOAD — Dynamically loads an object file
LOCK — Explicitly lock a table inside a transaction
MOVE — Moves cursor position
NOTIFY — Signals all frontends and backends listening on a notify condition
REINDEX — Recover corrupted system indexes under stand-alone Postgres
RESET — Restores run-time parameters to default values
REVOKE — Revokes access privilege from a user, a group or all users.
ROLLBACK — Aborts the current transaction
SELECT — Retrieves rows from a table or view
SELECT INTO — Creates a new table from the results of a SELECT
SET — Set run-time parameters
SET CONSTRAINTS — Set the constraint mode of the current SQL-transaction
SET TRANSACTION — Set the characteristics of the current SQL-transaction
SHOW — Shows run-time parameters
TRUNCATE — Empty a table
UNLISTEN — Stop listening for notification
UPDATE — Replaces values of columns in a table
VACUUM — Clean and analyze a Postgres database
II. PostgreSQL Client Applications
createdb — Create a new Postgres database
createuser — Create a new Postgres user
dropdb — Remove an existing Postgres database
dropuser — Drops (removes) a Postgres user
ecpg — Embedded SQL C preprocessor
pgaccessPostgreSQL graphical client
pgadminPostgres database management and design tool for Windows 95/98/NT
pg_config — Provides information about the installed version of PostgreSQL
pg_dump — Extract a Postgres database into a script file or other archive file
pg_dumpall — Extract all databases into a script file
pg_restore — Restore a Postgres database from an archive file created by pg_dump
psqlPostgres interactive terminal
pgtclshPostgreSQL Tcl shell client
pgtkshPostgreSQL Tcl/Tk shell client
vacuumdb — Clean and analyze a Postgres database
III. PostgreSQL Server Applications
createlang — Add a new programming language to a Postgres database
droplang — Remove a programming language from a Postgres database
initdb — Create a new Postgres database cluster
initlocation — Create a secondary Postgres database storage area
ipcclean — Clean up shared memory and semaphores from aborted backends
pg_ctl — Starts, stops, or restarts postmaster
pg_passwd — Manipulate a text password file
postgres — Run a PostgreSQL single-user backend
postmasterPostgreSQL multi-user database server
List of Examples
1. Example of a circular rewrite rule combination: