-
PostgreSQL Administrator's Guide
-
- Covering v6.4 for general release
-
- The PostgreSQL Development Team
-
+
PostgreSQL Administrator's Guide
+
+ Covering v6.4 for general release
+
+ The PostgreSQL Development Team
+
-
- Thomas
- Lockhart
- Caltech/JPL
-
-
+
+ Thomas
+ Lockhart
+ Caltech/JPL
+
+
-->
- (last updated 1998-10-27)
-
+ (last updated 1999-04-08)
+
-
-
PostgreSQL is copyright (C) 1998
-by the Postgres Global Development Group.
-
-
+
+
PostgreSQL is copyright (C) 1998-9
+ by the Postgres Global Development Group.
+
+
-
+
-
Summary
-
- developed originally in the UC Berkeley Computer Science Department,
- pioneered many of the object-relational concepts
- now becoming available in some commercial databases.
-It provides SQL92/SQL3 language support,
- transaction integrity, and type extensibility.
-
PostgreSQL is a public-domain, open source descendant
- of this original Berkeley code.
-
-
-
-&intro-ag;
-
-&ports;
-&config;
-&install;
-&installw;
-&runtime;
-&security;
-&options;
-&start-ag;
-&recovery;
-®ress;
-&release;
-
-&biblio;
+
Summary
+
+ developed originally in the UC Berkeley Computer Science Department,
+ pioneered many of the object-relational concepts
+ now becoming available in some commercial databases.
+ It provides SQL92/SQL3 language support,
+ transaction integrity, and type extensibility.
+
PostgreSQL is a public-domain, open source descendant
+ of this original Berkeley code.
+
+
+
+ &intro-ag;
+
+ &ports;
+ &config;
+ &install;
+ &installw;
+ &runtime;
+ &security;
+ &options;
+ &start-ag;
+ &recovery;
+ ®ress;
+ &release;
+
+ &biblio;
-
-
SQL Syntax
-
-
-
Key Words
-
-for the language
-which have specific meaning. Some key words are
-reserved, which indicates that they are
-restricted to appear in only certain contexts. Other key words are
-not restricted, which indicates that in certain
-contexts they
-have a specific meaning but are not otherwise constrained.
-
-
-
Postgres implements an extended subset of the
-
SQL92 and
SQL3 languages. Some language
-elements are not as restricted in this implementation as is
-called for in the language standards, in part due
-to the extensibility features of
Postgres.
-
-
-Information on
SQL92 and
SQL3 key words
-is derived from .
-
-
-
-
Reserved Key Words
-
-reserved key words which are not allowed
-as identifiers and not allowed in any usage other than as fundamental
-tokens in
SQL statements.
-
Postgres has additional key words
-which have similar restrictions. In particular, these key words
-are not allowed as column or table names, though in some cases
-they are allowed to be column labels (i.e. in AS clauses).
-
-
-
-Any string can be specified as an identifier if surrounded by
-double quotes (like this!
). Some care is required since
-such an identifier will be case sensitive
-and will retain embedded whitespace other special characters.
-
-
-The following are
Postgres
-reserved words which are neither
SQL92
-nor
SQL3 reserved words. These are allowed
-to be present as column labels, but not as identifiers:
-
+
+
SQL Syntax
+
+
SQL manipulates sets of data. The language is
+ composed of various key words. Arithmetic
+ and procedural expressions are allowed. We will cover these topics
+ in this chapter; subsequent chapters will include details on data
+ types, functions, and operators.
+
+
+
+
+
Key Words
+
+
SQL92 defines
key words
+ for the language
+ which have specific meaning. Some key words are
+ reserved, which indicates that they are
+ restricted to appear in only certain contexts. Other key words are
+ not restricted, which indicates that in certain
+ contexts they
+ have a specific meaning but are not otherwise constrained.
+
+
+
Postgres implements an extended subset of the
+
SQL92 and
SQL3 languages. Some language
+ elements are not as restricted in this implementation as is
+ called for in the language standards, in part due
+ to the extensibility features of
Postgres.
+
+
+ Information on
SQL92 and
SQL3 key words
+ is derived from .
+
+
+
+
Reserved Key Words
+
+ reserved key words which are not allowed
+ as identifiers and not allowed in any usage other than as fundamental
+ tokens in
SQL statements.
+
Postgres has additional key words
+ which have similar restrictions. In particular, these key words
+ are not allowed as column or table names, though in some cases
+ they are allowed to be column labels (i.e. in AS clauses).
+
+
+
+ Any string can be specified as an identifier if surrounded by
+ double quotes (like this!
). Some care is required since
+ such an identifier will be case sensitive
+ and will retain embedded whitespace other special characters.
+
+
+
+ The following are
Postgres
+ reserved words which are neither
SQL92
+ nor
SQL3 reserved words. These are allowed
+ to be present as column labels, but not as identifiers:
+
ABORT ANALYZE
BINARY
CLUSTER CONSTRAINT COPY
SETOF SHOW
UNLISTEN UNTIL
VACUUM VERBOSE
-
-
+
+
-The following are
Postgres
-reserved words which are also
SQL92
-or
SQL3 reserved words, and which
-are allowed to be present as column labels, but not as identifiers:
+
The following are
Postgres
+
reserved words which are also
SQL92
+
or
SQL3 reserved words, and which
+ are allowed to be present as column labels, but not as identifiers:
CASE COALESCE CROSS CURRENT
ELSE END
FALSE FOREIGN
-GROUP
+GLOBAL GROUP
+LOCAL
NULLIF
ORDER
POSITION PRECISION
TABLE THEN TRANSACTION TRUE
WHEN
-
+
-The following are
Postgres
-reserved words which are also
SQL92
+
The following are
Postgres
+
reserved words which are also
SQL92
+
or
SQL3 reserved words:
ADD ALL ALTER AND ANY AS ASC
BEGIN BETWEEN BOTH BY
CASCADE CAST CHAR CHARACTER CHECK CLOSE
UNION UNIQUE UPDATE USER USING
VALUES VARCHAR VARYING VIEW
WHERE WITH WORK
-
-
+
+
-The following are
SQL92 reserved key words which
-are not
Postgres reserved key words, but which
-if used as function names are always translated into the function
-length:
+
The following are
SQL92 reserved key words which
+
are not
Postgres reserved key words, but which
+ if used as function names are always translated into the function
+ length:
CHAR_LENGTH CHARACTER_LENGTH
-
-
+
+
-The following are
SQL92 or
SQL3
-reserved key words which
-are not
Postgres reserved key words, but
-if used as type names are always translated into an alternate, native type:
+
The following are
SQL92 or
SQL3
+ reserved key words which
+
are not
Postgres reserved key words, but
+ if used as type names are always translated into an alternate, native type:
BOOLEAN DOUBLE FLOAT INT INTEGER INTERVAL REAL SMALLINT
-
-
-
-The following are either
SQL92
-or
SQL3 reserved key words
-which are not key words in
Postgres.
-These have no proscribed usage in
Postgres
-at the time of writing (v6.4) but may become reserved key words in the
-future:
-
-
-Some of these key words represent functions in
SQL92.
-These functions are defined in
Postgres,
-but the parser does not consider the names to be key words and they are allowed
-in other contexts.
-
-
-
+
+
+
+
The following are either
SQL92
+
or
SQL3 reserved key words
+
which are not key words in
Postgres.
+
These have no proscribed usage in
Postgres
+ at the time of writing (v6.5) but may become reserved key words in the
+ future:
+
+
+
Some of these key words represent functions in
SQL92.
+
These functions are defined in
Postgres,
+ but the parser does not consider the names to be key words and they are allowed
+ in other contexts.
+
+
+
ALLOCATE ARE ASSERTION AT AUTHORIZATION AVG
BIT BIT_LENGTH
CASCADED CATALOG COLLATION CONNECT CONNECTION
DATE DEALLOCATE DEC DESCRIBE DESCRIPTOR DIAGNOSTICS DISCONNECT DOMAIN
END-EXEC ESCAPE EXCEPT EXCEPTION EXEC EXTERNAL
FIRST FOUND
-GET GLOBAL GO GOTO
+GET GO GOTO
IDENTITY IMMEDIATE INDICATOR INITIALLY INPUT INTERSECT ISOLATION
LAST LEVEL LOWER
MAX MIN MODULE
UNKNOWN UPPER USAGE
VALUE
WHENEVER WRITE
-
-
-
-
-
-
Non-reserved Keywords
-
-non-reserved keywords which have
-a proscribed meaning in the language but which are also allowed
-as identifiers.
-
Postgres has additional keywords
-which allow similar unrestricted usage.
-In particular, these keywords
-are allowed as column or table names.
-
-
-The following are
Postgres
-non-reserved key words which are neither
SQL92
-nor
SQL3 non-reserved key words:
-
-AFTER AGGREGATE
+
+
+
+
+
+
Non-reserved Keywords
+
+ non-reserved keywords which have
+ a proscribed meaning in the language but which are also allowed
+ as identifiers.
+
Postgres has additional keywords
+ which allow similar unrestricted usage.
+ In particular, these keywords
+ are allowed as column or table names.
+
+
+
The following are
Postgres
+
non-reserved key words which are neither
SQL92
+
nor
SQL3 non-reserved key words:
+
+ACCESS AFTER AGGREGATE
BACKWARD BEFORE
CACHE CREATEDB CREATEUSER CYCLE
DATABASE DELIMITERS
-EACH ENCODING
+EACH ENCODING EXCLUSIVE
FORWARD FUNCTION
HANDLER
INCREMENT INDEX INHERITS INSENSITIVE INSTEAD ISNULL
LANCOMPILER LOCATION
-MAXVALUE MINVALUE
+MAXVALUE MINVALUE MODE
NOCREATEDB NOCREATEUSER NOTHING NOTNULL
OIDS OPERATOR
PASSWORD PROCEDURAL
RECIPE RENAME RETURNS ROW RULE
-SEQUENCE SERIAL START STATEMENT STDIN STDOUT
+SEQUENCE SERIAL SHARE START STATEMENT STDIN STDOUT
TRUSTED
VALID VERSION
-
-
+
+
-The following are
Postgres
-non-reserved key words which are
SQL92
-or
SQL3 reserved key words:
+
The following are
Postgres
+
non-reserved key words which are
SQL92
+
or
SQL3 reserved key words:
ABSOLUTE ACTION
DAY
HOUR
TIME TIMESTAMP TIMEZONE_HOUR TIMEZONE_MINUTE TRIGGER
YEAR
ZONE
-
-
+
+
-The following are
Postgres
-non-reserved key words which are also either
SQL92
-or
SQL3 non-reserved key words:
+
The following are
Postgres
+
non-reserved key words which are also either
SQL92
+
or
SQL3 non-reserved key words:
-TYPE
-
-
+COMMITTED SERIALIZABLE TYPE
+
+
-The following are either
SQL92
-or
SQL3 non-reserved key words which are not
-key words of any kind in
Postgres:
+
The following are either
SQL92
+
or
SQL3 non-reserved key words which are not
+
key words of any kind in
Postgres:
ADA
C CATALOG_NAME CHARACTER_SET_CATALOG CHARACTER_SET_NAME
CHARACTER_SET_SCHEMA CLASS_ORIGIN COBOL COLLATION_CATALOG
COLLATION_NAME COLLATION_SCHEMA COLUMN_NAME
-COMMAND_FUNCTION COMMITTED CONDITION_NUMBER
+COMMAND_FUNCTION CONDITION_NUMBER
CONNECTION_NAME CONSTRAINT_CATALOG CONSTRAINT_NAME
CONSTRAINT_SCHEMA CURSOR_NAME
DATA DATE_TIME_INTERVAL_CODE DATE_TIME_INTERVAL_PRECISION
PAD PASCAL PLI
REPEATABLE RETURNED_LENGTH RETURNED_OCTET_LENGTH
RETURNED_SQLSTATE ROW_COUNT
-SCALE SCHEMA_NAME SERIALIZABLE SERVER_NAME SPACE
+SCALE SCHEMA_NAME SERVER_NAME SPACE
SUBCLASS_ORIGIN
TABLE_NAME
UNCOMMITTED UNNAMED
-
-
-
-
-
+
+
+
+
+
+
+
Expressions
+
+
SQL92 allows
expressions
+ to transform data in expressions. Expressions may contain operators
+ (see
+ for more details) and functions
+ ( has
+ more information).
+
+
+
+