PostgreSQL 7.2 Reference Manual
The PostgreSQL Global Development Group
Copyright
© 1996-2001 by 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
ANALYZE
— Collect statistics about a
Postgres
database
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 an index from the 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
— Loads a shared 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 SESSION AUTHORIZATION
— Set the session user identifier and the current user identifier of the current SQL-session context
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 optionally 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
pgaccess
—
PostgreSQL
graphical client
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
psql
—
Postgres
interactive terminal
pgtclsh
—
PostgreSQL
Tcl
shell client
pgtksh
—
PostgreSQL
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
postmaster
—
PostgreSQL
multi-user database server
List of Examples
1.
Example of a circular rewrite rule combination:
Prev
Home
Next
Using
SQL Commands