PostgreSQL User's Guide

The PostgreSQL Development Team

Edited by

Thomas Lockhart

PostgreSQL is Copyright © 1996-2000 by PostgreSQL Inc.


Table of Contents
Summary
1. Introduction
What is Postgres?
A Short History of Postgres
The Berkeley Postgres Project
Postgres95
PostgreSQL
About This Release
Resources
Terminology
Notation
Problem Reporting Guidelines
Identifying Bugs
What to report
Where to report bugs
Y2K Statement
Copyrights and Trademarks
2. SQL Syntax
Key Words
Reserved Key Words
Non-reserved Keywords
Comments
Names
Constants
String Constants
Integer Constants
Floating Point Constants
Constants of Postgres User-Defined Types
Array constants
Fields and Columns
Fields
Columns
Operators
Expressions
Parameters
Functional Expressions
Aggregate Expressions
Target List
Qualification
From List
3. Data Types
Numeric Types
The Serial Type
Monetary Type
Character Types
Date/Time Types
Date/Time Input
Date/Time Output
Time Zones
Internals
Boolean Type
Geometric Types
Point
Line Segment
Box
Path
Polygon
Circle
IP Version 4 Networks and Host Addresses
CIDR
inet
4. Operators
Lexical Precedence
General Operators
Numerical Operators
Geometric Operators
Time Interval Operators
IP V4 CIDR Operators
IP V4 INET Operators
5. Functions
SQL Functions
Mathematical Functions
String Functions
Date/Time Functions
Formatting Functions
Geometric Functions
IP V4 Functions
6. Type Conversion
Overview
Guidelines
Operators
Conversion Procedure
Examples
Functions
Examples
Query Targets
Examples
UNION Queries
Examples
7. Indices and Keys
Keys
Partial Indices
8. Arrays
9. Inheritance
10. PL/pgSQL - SQL Procedural Language
Overview
Description
Structure of PL/pgSQL
Comments
Declarations
Data Types
Expressions
Statements
Trigger Procedures
Exceptions
Examples
Some Simple PL/pgSQL Functions
PL/pgSQL Function on Composite Type
PL/pgSQL Trigger Procedure
11. PL/Tcl - TCL Procedural Language
Overview
Description
Postgres Functions and Tcl Procedure Names
Defining Functions in PL/Tcl
Global Data in PL/Tcl
Trigger Procedures in PL/Tcl
Database Access from PL/Tcl
12. PL/perl - Perl Procedural Language
Overview
Building and Installing
Using PL/Perl
13. Multi-Version Concurrency Control
Introduction
Transaction Isolation
Read Committed Isolation Level
Serializable Isolation Level
Locking and Tables
Table-level locks
Row-level locks
Locking and Indices
Data consistency checks at the application level
14. Setting Up Your Environment
15. Managing a Database
Database Creation
Alternate Database Locations
Accessing a Database
Database Privileges
Table Privileges
Destroying a Database
16. Disk Storage
17. Understanding Performance
Using EXPLAIN
18. Populating a Database
Disable Auto-commit
Use COPY FROM
Remove Indices
19. SQL Commands
ABORT
ALTER GROUP
ALTER TABLE
ALTER USER
BEGIN
CLOSE
CLUSTER
COMMENT
COMMIT
COPY
CREATE AGGREGATE
CREATE CONSTRAINT TRIGGER
CREATE DATABASE
CREATE FUNCTION
CREATE GROUP
CREATE INDEX
CREATE LANGUAGE
CREATE OPERATOR
CREATE RULE
CREATE SEQUENCE
CREATE TABLE
CREATE TABLE AS
CREATE TRIGGER
CREATE TYPE
CREATE USER
CREATE VIEW
DECLARE
DELETE
DROP AGGREGATE
DROP DATABASE
DROP FUNCTION
DROP GROUP
DROP INDEX
DROP LANGUAGE
DROP OPERATOR
DROP RULE
DROP SEQUENCE
DROP TABLE
DROP TRIGGER
DROP TYPE
DROP USER
DROP VIEW
END
EXPLAIN
FETCH
GRANT
INSERT
LISTEN
LOAD
LOCK
MOVE
NOTIFY
REINDEX
RESET
REVOKE
ROLLBACK
SELECT
SELECT INTO
SET
SHOW
TRUNCATE
UNLISTEN
UPDATE
VACUUM
20. Applications
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
pgaccess
pgadmin
pg_ctl
pg_dump
pg_dumpall
psql
pgtclsh
pgtksh
vacuumdb
21. System Applications
initdb
initlocation
ipcclean
pg_passwd
pg_upgrade
postgres
postmaster
UG1. Date/Time Support
Time Zones
Australian Time Zones
Date/Time Input Interpretation
History of Units
Bibliography