Commit 52ca2ab2 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Editing and markup cleanup.

parent 748e3003
...@@ -182,7 +182,7 @@ The keyword COLUMN is noise and can be omitted. ...@@ -182,7 +182,7 @@ The keyword COLUMN is noise and can be omitted.
<Quote>[*]</Quote> following a name of a table indicates that statement <Quote>[*]</Quote> following a name of a table indicates that statement
should be run over that table and all tables below it in the should be run over that table and all tables below it in the
inheritance hierarchy. inheritance hierarchy.
The PostgreSQL User's Guide has further The <citetitle>PostgreSQL User's Guide</citetitle> has further
information on inheritance. information on inheritance.
<PARA> <PARA>
......
...@@ -41,7 +41,7 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable> ...@@ -41,7 +41,7 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Causes the system to check for Causes the system to check for
duplicate values when the index is created (if data duplicate values in the table when the index is created (if data
already exist) and each time data is added. Attempts to already exist) and each time data is added. Attempts to
insert or update non-duplicate data will generate an insert or update non-duplicate data will generate an
error. error.
...@@ -76,7 +76,7 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable> ...@@ -76,7 +76,7 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
<PARA> <PARA>
the name of the access method which is to be used for the name of the access method which is to be used for
the index. The default access method is BTREE. the index. The default access method is BTREE.
Postgres provides three access methods for secondary indices: Postgres provides three access methods for secondary indexes:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>BTREE</term> <term>BTREE</term>
...@@ -208,14 +208,14 @@ SELECT am.amname AS acc_name, ...@@ -208,14 +208,14 @@ SELECT am.amname AS acc_name,
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
This command constructs an index <command>CREATE INDEX</command> constructs an index
<replaceable class="parameter">index_name</replaceable>. <replaceable class="parameter">index_name</replaceable>.
on the specified on the specified
<replaceable class="parameter">table</replaceable>. <replaceable class="parameter">table</replaceable>.
<tip> <tip>
<para> <para>
Indices are primarily used to enhance database performance. Indexes are primarily used to enhance database performance.
But inappropriate use will result in slower performance. But inappropriate use will result in slower performance.
</tip> </tip>
...@@ -236,7 +236,7 @@ But inappropriate use will result in slower performance. ...@@ -236,7 +236,7 @@ But inappropriate use will result in slower performance.
on the result of a user-defined function on the result of a user-defined function
<replaceable class="parameter">func_name</replaceable> applied <replaceable class="parameter">func_name</replaceable> applied
to one or more attributes of a single class. These functional to one or more attributes of a single class. These functional
indices can be used to obtain fast access to data indexes can be used to obtain fast access to data
based on operators that would normally require some based on operators that would normally require some
transformation to apply them to the base data. transformation to apply them to the base data.
</para> </para>
...@@ -250,7 +250,7 @@ But inappropriate use will result in slower performance. ...@@ -250,7 +250,7 @@ But inappropriate use will result in slower performance.
</TITLE> </TITLE>
<PARA> <PARA>
Currently, only the BTREE access method supports multi-column Currently, only the BTREE access method supports multi-column
indices. Up to 7 keys may be specified. indexes. Up to 7 keys may be specified.
</PARA> </PARA>
<para> <para>
Use <command>DROP INDEX</command> Use <command>DROP INDEX</command>
......
...@@ -40,9 +40,10 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname< ...@@ -40,9 +40,10 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname<
<PARA> <PARA>
<function> TRUSTED</function> specifies that the call handler for <function> TRUSTED</function> specifies that the call handler for
the language is safe; that is, it offers an unprivileged user the language is safe; that is, it offers an unprivileged user
no functionality to get around access restrictions. If no functionality to bypass access restrictions. If
this keyword is omitted when registering the language, this keyword is omitted when registering the language,
only users with the PostgreSQL superuser privilege can use only users with the <productname>Postgres</productname>
superuser privilege can use
this language to create new functions this language to create new functions
(like the 'C' language). (like the 'C' language).
</PARA> </PARA>
...@@ -58,17 +59,17 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname< ...@@ -58,17 +59,17 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname<
The name of the new procedural language. The name of the new procedural language.
The language name is case insensitive. A procedural The language name is case insensitive. A procedural
language cannot override one of the built-in languages of language cannot override one of the built-in languages of
PostgreSQL. <productname>Postgres</productname>.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable class="parameter">call_handler</replaceable> HANDLER <replaceable class="parameter">call_handler</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The argument for <function>HANDLER</function> is the name <replaceable class="parameter">call_handler</replaceable> is the name
of a previously of a previously
registered function that will be called to execute the PL registered function that will be called to execute the PL
procedures. procedures.
...@@ -86,7 +87,7 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname< ...@@ -86,7 +87,7 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname<
inserted in the <literal>LANCOMPILER</literal> attribute inserted in the <literal>LANCOMPILER</literal> attribute
of the new of the new
<filename>pg_language</filename> entry. At present, <filename>pg_language</filename> entry. At present,
PostgreSQL doesn't use <productname>Postgres</productname> does not use
this attribute in any way. this attribute in any way.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
...@@ -364,7 +365,8 @@ CREATE PROCEDURAL LANGUAGE 'plsample' ...@@ -364,7 +365,8 @@ CREATE PROCEDURAL LANGUAGE 'plsample'
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no <command>CREATE LANGUAGE</command> statement in SQL92. There is no <command>CREATE LANGUAGE</command> statement in
<acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -15,25 +15,25 @@ ...@@ -15,25 +15,25 @@
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
CREATE TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> ( CREATE TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> (
<REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> [DEFAULT <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>] [CONSTRAINT <REPLACEABLE CLASS="PARAMETER">column_constraint</REPLACEABLE>] [, ...] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> [ DEFAULT <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE> | <REPLACEABLE>column_constraint_clause</REPLACEABLE> | PRIMARY KEY } [ ... ] ]
[, <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> ...] [, ... ]
[, CONSTRAINT <REPLACEABLE CLASS="PARAMETER">table_constraint</REPLACEABLE>] [, PRIMARY KEY ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ]
) [INHERITS ( <REPLACEABLE CLASS="PARAMETER">inherited_table</REPLACEABLE> [, ...] )] [, <REPLACEABLE>table_constraint_clause</REPLACEABLE> ]
) [ INHERITS ( <REPLACEABLE>inherited_table</REPLACEABLE> [, ...] ) ]
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-CREATETABLE-1"> <REFSECT2 ID="R2-SQL-CREATETABLE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
...@@ -64,16 +64,16 @@ ...@@ -64,16 +64,16 @@
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The type of the column. The type of the column. This may include array specifiers.
(Refer to the <ProductName>Postgres</ProductName> User's Guide for Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for
further information about data types). further information about data types and arrays.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE> DEFAULT <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -85,37 +85,63 @@ ...@@ -85,37 +85,63 @@
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<REPLACEABLE CLASS="PARAMETER">inherited_table</REPLACEABLE> <REPLACEABLE>column_constraint_clause</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The optional INHERITS clause specifies a collection of table The optional column constraint clause specifies a list of integrity
names from which this table automatically inherits all fields. constraints which new or updated entries must satisfy for
If any inherited field name appears more than once, PostgreSQL an insert or update operation to succeed. Each constraint
reports an error. PostgreSQL automatically allows the created must evaluate to a boolean expression. Although <acronym>SQL92</acronym>
table to inherit functions on tables above it in the inheritance requires the <REPLACEABLE CLASS="PARAMETER">column_constraint_clause</REPLACEABLE>
hierarchy. Inheritance of functions is done according to refer to that column only, <ProductName>Postgres</ProductName>
to the conventions of the Common Lisp Object System (CLOS). allows multiple columns
to be referenced within a single column constraint.
See the column constraint clause for more information.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<REPLACEABLE CLASS="PARAMETER">column_constraint</REPLACEABLE> <REPLACEABLE>table_constraint_clause</REPLACEABLE>
<REPLACEABLE CLASS="PARAMETER">table_constraint</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The optional CONSTRAINT clause specifies a list of integrity The optional table CONSTRAINT clause specifies a list of integrity
constraints which new or updated entries must satisfy for constraints which new or updated entries must satisfy for
an insert or update operation to succeed. Each constraint an insert or update operation to succeed. Each constraint
must evaluate to a boolean expression. Multiple columns must evaluate to a boolean expression. Multiple columns
may be referenced within a single constraint. may be referenced within a single constraint.
See CONSTRAINT clause for more information. See the table constraint clause for more information.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY>
<TERM>
INHERITS <REPLACEABLE CLASS="PARAMETER">inherited_table</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
The optional INHERITS clause specifies a collection of table
names from which this table automatically inherits all fields.
If any inherited field name appears more than once,
<productname>Postgres</productname>
reports an error.
<productname>Postgres</productname> automatically allows the created
table to inherit functions on tables above it in the inheritance
hierarchy.
<note>
<title>Aside</title>
<para>
Inheritance of functions is done according
to the conventions of the Common Lisp Object System (CLOS).
</note>
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST> </VARIABLELIST>
...@@ -123,7 +149,7 @@ ...@@ -123,7 +149,7 @@
<REFSECT2 ID="R2-SQL-CREATETABLE-2"> <REFSECT2 ID="R2-SQL-CREATETABLE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -158,13 +184,26 @@ ...@@ -158,13 +184,26 @@
Message returned if table creation failed. Message returned if table creation failed.
This is usually accompanied by some descriptive text, such as: This is usually accompanied by some descriptive text, such as:
<ProgramListing> <ProgramListing>
amcreate: "<replaceable class="parameter">table</replaceable>" relation already exists amcreate: "<replaceable class="parameter">table</replaceable>" relation already exists
</ProgramListing> </ProgramListing>
which occurs at runtime, if the table specified already exists which occurs at runtime, if the table specified already exists
in the database. in the database.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>ERROR: DEFAULT: type mismatched</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
if data type of default value doesn't match the
column definition's data type.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST> </VARIABLELIST>
</PARA> </PARA>
</LISTITEM> </LISTITEM>
...@@ -175,13 +214,13 @@ ...@@ -175,13 +214,13 @@
<REFSECT1 ID="R1-SQL-CREATETABLE-1"> <REFSECT1 ID="R1-SQL-CREATETABLE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
CREATE TABLE will enter a new table into the current data <command>CREATE TABLE</command> will enter a new table into the current data
base. The table will be "owned" by the user issuing the base. The table will be "owned" by the user issuing the
command. command.
...@@ -194,34 +233,35 @@ ...@@ -194,34 +233,35 @@
a system catalog table. a system catalog table.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-DEFAULTCLAUSE-1">
<REFSECT2INFO> <REFSECT1 ID="R1-SQL-DEFAULTCLAUSE-1">
<DATE>1998-04-15</DATE> <REFSECT1INFO>
</REFSECT2INFO> <DATE>1998-09-11</DATE>
</REFSECT1INFO>
<TITLE> <TITLE>
DEFAULT clause DEFAULT Clause
</TITLE> </TITLE>
<PARA> <PARA>
<SYNOPSIS> <SYNOPSIS>
DEFAULT <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE> DEFAULT <REPLACEABLE CLASS="PARAMETER">value</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<PARA>
The DEFAULT clause assigns a default data value to a column. <REFSECT2 ID="R2-SQL-DEFAULTCLAUSE-1">
</PARA> <REFSECT2INFO>
<VARIABLELIST> <DATE>1998-09-11</DATE>
<VARLISTENTRY> </REFSECT2INFO>
<TERM> <TITLE>
</TERM> Inputs
<LISTITEM> </TITLE>
<PARA> <PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">value</replaceable></ReturnValue> <replaceable class="parameter">value</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The possible values for expression are: The possible values for the default value expression are:
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<simpara> <simpara>
...@@ -243,19 +283,24 @@ ...@@ -243,19 +283,24 @@
</listitem> </listitem>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>ERROR: DEFAULT: type mismatched</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
if data type of default value doesn't match the
column definition's data type.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</variablelist> </variablelist>
<PARA> <REFSECT2 ID="R2-SQL-DEFAULTCLAUSE-2">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
Outputs
</TITLE>
<PARA>
<REFSECT2 ID="R2-SQL-DEFAULTCLAUSE-3">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
Description
</TITLE>
<PARA>
The DEFAULT clause assigns a default data value to a column The DEFAULT clause assigns a default data value to a column
(via a column definition in the CREATE TABLE statement). (via a column definition in the CREATE TABLE statement).
The data type of a default value must match the column definition's The data type of a default value must match the column definition's
...@@ -273,7 +318,8 @@ ...@@ -273,7 +318,8 @@
is the value of the specified function at the time of the INSERT. is the value of the specified function at the time of the INSERT.
</PARA> </PARA>
<PARA> <PARA>
There are two types of niladic functions:<variablelist> There are two types of niladic functions:
<variablelist>
<varlistentry> <varlistentry>
<term>niladic USER</term> <term>niladic USER</term>
<listitem> <listitem>
...@@ -325,53 +371,208 @@ ...@@ -325,53 +371,208 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY> <para>
</VARIABLELIST> In the current release (v6.4), <productname>Postgres</productname>
</REFSECT2> evaluates all default expressions at the time the table is defined.
Hence, functions which are "non-cacheable" such as
<REFSECT2 ID="R2-SQL-NOTNULL-1"> <function>CURRENT_TIMESTAMP</function> may not produce the desired
effect. For the particular case of date/time types, one can work
around this behavior by using
<quote>
DEFAULT TEXT 'now'
</quote>
instead of
<quote>
DEFAULT 'now'
</quote>
or
<quote>
DEFAULT CURRENT_TIMESTAMP
</quote>.
This forces <productname>Postgres</productname> to consider the constant a string
type and then to convert the value to <type>timestamp</type> at runtime.
<REFSECT2 ID="R2-SQL-DEFAULTCLAUSE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
NOT NULL constraint Usage
</TITLE>
<PARA>
To assign a constant value as the default for the
columns <literal>did</literal> and <literal>number</literal>,
and a string literal to the column <literal>did</literal>:
<ProgramListing>
CREATE TABLE video_sales (
did VARCHAR(40) DEFAULT 'luso films',
number INTEGER DEFAULT 0,
total CASH DEFAULT '$0.0'
);
</ProgramListing>
<PARA>
To assign an existing sequence
as the default for the column <literal>did</literal>,
and a literal to the column <literal>name</literal>:
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3) DEFAULT NEXTVAL('serial'),
name VARCHAR(40) DEFAULT 'luso films'
);
</ProgramListing>
</REFSECT1>
<REFSECT1 ID="R1-SQL-COLUMNCONSTRAINT-1">
<REFSECT1INFO>
<DATE>1998-09-11</DATE>
</REFSECT1INFO>
<TITLE>
Column CONSTRAINT Clause
</TITLE> </TITLE>
<para>
<SYNOPSIS> <SYNOPSIS>
[ CONSTRAINT <replaceable class="parameter">name</replaceable> ] NOT NULL [ CONSTRAINT <replaceable class="parameter">name</replaceable> ] { NOT NULL | UNIQUE | PRIMARY KEY | CHECK <replaceable class="parameter">constraint</replaceable> } [, ...]
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-COLUMNCONSTRAINT-1">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
Inputs
</TITLE>
<PARA> <PARA>
The NOT NULL constraint specifies a rule that a column may <VARIABLELIST>
contain only non-null values. <VARLISTENTRY>
</PARA> <TERM>
<PARA> <replaceable class="parameter">name</replaceable>
The NOT NULL constraint is a column constraint. </TERM>
</PARA> <LISTITEM>
<VARIABLELIST> <PARA>
An arbitrary name given to the integrity constraint.
If <replaceable class="parameter">name</replaceable> is not specified,
it is generated from the table and column names,
which should ensure uniqueness for
<replaceable class="parameter">name</replaceable>.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
NOT NULL
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
<VARIABLELIST> The column is not allowed to contain NULL values.
This is equivalent to the column constraint
CHECK (<REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> NOT NULL).
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
UNIQUE
</TERM>
<LISTITEM>
<PARA>
The column must have unique values. In <ProductName>Postgres</ProductName>
this is enforced by an implicit creation of a unique index on the table.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
PRIMARY KEY
</TERM>
<LISTITEM>
<PARA>
This column is a primary key, which implies that uniqueness is
enforced by the system and that other tables may rely on this column
as a unique identifier for rows.
See PRIMARY KEY for more information.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">name</replaceable></ReturnValue> <replaceable class="parameter">constraint</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The optional name of a constraint. The definition of the constraint.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </VARIABLELIST>
</LISTITEM>
</VARLISTENTRY> <REFSECT2 ID="R2-SQL-COLUMNCONSTRAINT-2">
</VARIABLELIST> <REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
Description
</TITLE>
<para>
A Constraint is a named rule: an SQL object which helps define
valid sets of values by putting limits on the results of INSERT,
UPDATE or DELETE operations performed on a Base Table.
</para>
<para>
There are two ways to define integrity constraints:
table constraints, covered later, and column constraints, covered here.
</para>
<para>
A column constraint is an integrity constraint defined as part
of a column definition, and logically becomes a table
constraint as soon as it is created. The column
constraints available are:
<simplelist columns="1">
<member>PRIMARY KEY</member>
<member>REFERENCES</member>
<member>UNIQUE</member>
<member>CHECK</member>
<member>NOT NULL</member>
</simplelist></para>
<note>
<para>
<productname>Postgres</productname> does not yet
(at release 6.4) support
REFERENCES integrity constraints. The parser
accepts the REFERENCES syntax but ignores the clause.
</para>
</note>
<REFSECT2 ID="R2-SQL-NOTNULL-1">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
NOT NULL Constraint
</TITLE>
<SYNOPSIS>
[ CONSTRAINT <replaceable class="parameter">name</replaceable> ] NOT NULL
</SYNOPSIS>
<PARA>
The NOT NULL constraint specifies a rule that a column may
contain only non-null values.
</PARA>
<PARA>
The NOT NULL constraint is a column constraint only, and not allowed
as a table constraint.
</PARA>
<REFSECT3 ID="R3-SQL-NOTNULL-1"> <REFSECT3 ID="R3-SQL-NOTNULL-1">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -381,6 +582,7 @@ ...@@ -381,6 +582,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -401,34 +603,434 @@ ...@@ -401,34 +603,434 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</VARIABLELIST> </VARIABLELIST>
<REFSECT3 ID="R3-SQL-NOTNULL-2">
<REFSECT3INFO>
<DATE>1998-09-11</DATE>
</REFSECT3INFO>
<TITLE>
Description
</title>
<para>
<REFSECT3 ID="R3-SQL-NOTNULL-3">
<REFSECT3INFO>
<DATE>1998-09-11</DATE>
</REFSECT3INFO>
<TITLE>
Usage
</title>
<PARA>
Define two NOT NULL column constraints on the table
<classname>distributors</classname>,
one of which being a named constraint:
</PARA>
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3) CONSTRAINT no_null NOT NULL,
name VARCHAR(40) NOT NULL
);
</ProgramListing>
<REFSECT2 ID="R2-SQL-UNIQUECLAUSE-1">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
UNIQUE Constraint
</TITLE>
<synopsis>
[ CONSTRAINT <replaceable class="parameter">name</replaceable> ] UNIQUE
</SYNOPSIS>
<refsect3>
<title>Inputs</title>
<para>
<variablelist>
<varlistentry>
<term>
CONSTRAINT <replaceable class="parameter">name</replaceable>
</term>
<listitem>
<para>
An arbitrary label given to a constraint.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect3>
<refsect3>
<title>Outputs</title>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<returnvalue>ERROR: Cannot insert a duplicate key into a unique index.</returnvalue>
</term>
<listitem>
<para>
This error occurs at runtime if one tries to insert a
duplicate value into a column.
</para>
</listitem>
</varlistentry>
</variablelist></para>
</listitem>
</varlistentry>
</variablelist>
</refsect3>
<refsect3>
<title>
Description
</title>
<PARA>
The UNIQUE constraint specifies a rule that a group of one or
more distinct columns of a table may contain only unique values.
</para>
<para>
The column definitions of the specified columns do not have to
include a NOT NULL constraint to be included in a UNIQUE
constraint. Having more than one null value in a column without a
NOT NULL constraint, does not violate a UNIQUE constraint.
(This deviates from the <acronym>SQL92</acronym> definition, but
is a more sensible convention. See the section on compatibility
for more details.).
</PARA>
<PARA>
Each UNIQUE column constraint must name a column that is
different from the set of columns named by any other UNIQUE or
PRIMARY KEY constraint defined for the table.
</PARA>
<Note>
<Para>
<productname>Postgres</productname> automatically creates a unique
index for each UNIQUE constraint, to assure
data integrity. See CREATE INDEX for more information.
</Para>
</Note>
<REFSECT3 ID="R3-SQL-UNIQUECLAUSE-3">
<TITLE>
Usage
</title>
<PARA>
Defines a UNIQUE column constraint for the table distributors.
UNIQUE column constraints can only be defined on one column
of the table:
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3),
name VARCHAR(40) UNIQUE
);
</ProgramListing>
which is equivalent to the following specified as a table constraint:
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3),
name VARCHAR(40),
UNIQUE(name)
);
</ProgramListing>
<REFSECT2 ID="R2-SQL-CHECK-1">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<title>
The CHECK Constraint
</title>
<SYNOPSIS>
[ CONSTRAINT <replaceable class="parameter">name</replaceable> ] CHECK ( <replaceable>condition</replaceable> [, ...] )
</SYNOPSIS>
<refsect3 id="R3-SQL-CHECK-1">
<title>Inputs</title>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<ReturnValue><replaceable class="parameter">name</replaceable></ReturnValue>
</TERM>
<LISTITEM>
<PARA>
An arbitrary name given to a constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<replaceable>condition</replaceable>
</TERM>
<LISTITEM>
<PARA>
Any valid conditional expression evaluating to a boolean result.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</variablelist>
</REFSECT3> </REFSECT3>
<REFSECT3 ID="R3-SQL-CHECK-2">
<REFSECT3INFO>
<DATE>1998-09-11</DATE>
</REFSECT3INFO>
<TITLE>
Outputs
</TITLE>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<ReturnValue>
ERROR: ExecAppend: rejected due to CHECK constraint
"<replaceable class="parameter">table_column</replaceable>".
</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
This error occurs at runtime if one tries to insert an illegal
value into a column subject to a CHECK constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</variablelist>
</LISTITEM>
</VARLISTENTRY>
</variablelist>
</REFSECT3>
<refsect3>
<title>Description</title>
<para>
The CHECK constraint specifies a restriction on allowed values
within a column.
The CHECK constraint is also allowed as a table constraint.
</PARA>
<PARA>
The SQL92 CHECK column constraints can only be defined on, and
refer to, one column of the table. <productname>Postgres</productname>
does not have
this restriction.
</PARA>
</refsect3>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-UNIQUECLAUSE-1"> <REFSECT2 ID="R2-SQL-PRIMARYKEY-1">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<TITLE>
PRIMARY KEY Constraint
</TITLE>
<SYNOPSIS>
[ CONSTRAINT <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ] PRIMARY KEY
</SYNOPSIS>
<refsect3>
<title>Inputs</title>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
CONSTRAINT <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
An arbitrary name for the constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</para>
</refsect3>
<refsect3>
<title>Outputs</title>
<variablelist>
<varlistentry>
<term>
<returnvalue>ERROR: Cannot insert a duplicate key into a unique index.</returnvalue>
</term>
<listitem>
<para>
This occurs at run-time if one tries to insert a duplicate value into
a column subject to a PRIMARY KEY constraint.
</PARA>
</listitem>
</varlistentry>
</variablelist>
</refsect3>
<refsect3>
<title>Description</title>
<PARA>
The PRIMARY KEY column constraint specifies that a column of a table
may contain only unique
(non-duplicate), non-NULL values. The definition of
the specified column does not have to include an explicit NOT NULL
constraint to be included in a PRIMARY KEY constraint.
</PARA>
<PARA>
Only one PRIMARY KEY can be specified for a table.
</PARA>
</REFSECT3>
<REFSECT3 ID="R3-SQL-PRIMARYKEY-3">
<REFSECT3INFO>
<DATE>1998-09-11</DATE>
</REFSECT3INFO>
<TITLE>
Notes
</TITLE>
<PARA>
<productname>Postgres</productname> automatically creates
a unique index to assure
data integrity. (See CREATE INDEX statement)
</PARA>
<PARA>
The PRIMARY KEY constraint should name a set of columns that is
different from other sets of columns named by any UNIQUE constraint
defined for the same table, since it will result in duplication
of equivalent indexes and unproductive additional runtime overhead.
However, <productname>Postgres</productname> does not specifically
disallow this.
</PARA>
</refsect3>
<REFSECT1 ID="R1-SQL-TABLECONSTRAINT-1">
<REFSECT1INFO>
<DATE>1998-09-11</DATE>
</REFSECT1INFO>
<TITLE>
Table CONSTRAINT Clause
</TITLE>
<para>
<SYNOPSIS>
[ CONSTRAINT name ] { PRIMARY KEY | UNIQUE } ( <replaceable class="parameter">column</replaceable> [, ...] )
[ CONSTRAINT name ] CHECK ( <replaceable>constraint</replaceable> )
</SYNOPSIS>
<PARA>
<REFSECT2 ID="R2-SQL-TABLECONSTRAINT-1">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<title>
Inputs
</title>
<para>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
CONSTRAINT <replaceable class="parameter">name</replaceable>
</TERM>
<LISTITEM>
<PARA>
An arbitrary name given to an integrity constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<replaceable class="parameter">column</replaceable> [, ...]
</TERM>
<LISTITEM>
<PARA>
The column name(s) for which to define a unique index
and, for PRIMARY KEY, a NOT NULL constraint.
</PARA>
</LISTITEM>
<VARLISTENTRY>
<TERM>
CHECK ( <replaceable class="parameter">constraint</replaceable> )
</TERM>
<LISTITEM>
<PARA>
A boolean expression to be evaluated as the constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<REFSECT2 ID="R2-SQL-TABLECONSTRAINT-2">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<title>
Outputs
</title>
<para>
The possible outputs for the table constraint clause are the same
as for the corresponding portions of the column constraint clause.
<REFSECT2 ID="R2-SQL-TABLECONSTRAINT-3">
<REFSECT2INFO>
<DATE>1998-09-11</DATE>
</REFSECT2INFO>
<title>
Description
</title>
<para>
A table constraint is an integrity constraint defined on one or
more columns of a base table. The four variations of "Table
Constraint" are:
<simplelist columns="1">
<member>UNIQUE</member>
<member>CHECK</member>
<member>PRIMARY KEY</member>
<member>FOREIGN KEY</member>
</simplelist>
</para>
<note>
<para>
<productname>Postgres</productname> does not yet
(as of version 6.4) support FOREIGN KEY
integrity constraints. The parser understands the FOREIGN KEY syntax,
but only prints a notice and otherwise ignores the clause.
Foreign keys may be partially emulated by triggers (See the CREATE TRIGGER
statement).
</para>
</note>
<REFSECT2 ID="R2-SQL-UNIQUECLAUSE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
UNIQUE constraint UNIQUE Constraint
</TITLE> </TITLE>
<para> <para>
Table Constraint definition
</para>
<synopsis>
[ CONSTRAINT <replaceable class="parameter">name</replaceable> ] UNIQUE ( <replaceable class="parameter">column</replaceable> [, ...] )
</SYNOPSIS>
<para>
Column Constraint definition
</para>
<synopsis> <synopsis>
[ CONSTRAINT <replaceable class="parameter">name</replaceable> ] UNIQUE [ CONSTRAINT <replaceable class="parameter">name</replaceable> ] UNIQUE ( <replaceable class="parameter">column</replaceable> [, ...] )
</SYNOPSIS> </SYNOPSIS>
<refsect3> <refsect3>
<title>Parameters</title> <title>Inputs</title>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
<replaceable class="parameter">name</replaceable> CONSTRAINT <replaceable class="parameter">name</replaceable>
</term> </term>
<listitem> <listitem>
<para> <para>
...@@ -451,10 +1053,10 @@ ...@@ -451,10 +1053,10 @@
<refsect3> <refsect3>
<title>Outputs</title> <title>Outputs</title>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -470,254 +1072,63 @@ ...@@ -470,254 +1072,63 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist></para> </variablelist>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</refsect3> </refsect3>
<refsect3> <refsect3>
<title>Description</title> <title>
Description
</title>
<PARA> <PARA>
The UNIQUE constraint specifies a rule that a group of one or The UNIQUE constraint specifies a rule that a group of one or
more distinct columns of a table may contain only unique values. more distinct columns of a table may contain only unique values.
The behavior of the UNIQUE table constraint is the same as that for column
constraints, with the additional capability to span multiple columns.
</para> </para>
<para> <para>
The column definitions of the specified columns do not have to See the section on the UNIQUE column constraint for more details.
include a NOT NULL constraint to be included in a UNIQUE
constraint. Having more than one null value in a column without a <REFSECT3 ID="R3-SQL-UNIQUECLAUSE-4">
NOT NULL constraint, does not violate a UNIQUE constraint.
</PARA>
<PARA>
Each UNIQUE constraint must name a set of columns that is
different from the set of columns named by any other UNIQUE or
PRIMARY KEY constraint defined for the Table.
</PARA>
<Note>
<Para>
PostgreSQL automatically creates a unique index for each UNIQUE
constraint, to assure
data integrity. See CREATE INDEX for more information.
</Para>
</Note>
</REFSECT2>
<REFSECT2 ID="R2-SQL-CONSTRAINT-1">
<REFSECT2INFO>
<DATE>1998-04-15</DATE>
</REFSECT2INFO>
<TITLE> <TITLE>
CONSTRAINT clause Usage
</TITLE> </title>
<para>
Table constraint definition <PARA>
</para> Define a UNIQUE table constraint for the table distributors:
<SYNOPSIS> <ProgramListing>
[ CONSTRAINT name ] CREATE TABLE distributors (
{ PRIMARY KEY constraint | did DECIMAL(03),
UNIQUE constraint | name VARCHAR(40),
CHECK constraint } UNIQUE(name)
</SYNOPSIS> );
<PARA> </ProgramListing>
Column constraint definition
</PARA>
<SYNOPSIS>
[ CONSTRAINT name ]
{ NOT NULL constraint |
PRIMARY KEY constraint |
UNIQUE constraint |
CHECK constraint }
</SYNOPSIS>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<ReturnValue>
<replaceable class="parameter">name</replaceable>
</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
An arbitrary name given to an integrity constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>
<replaceable class="parameter">constraint</replaceable>
</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
The definition of the constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<para>
A Constraint is a named rule: a SQL object which helps define
valid sets of values by putting limits on the results of INSERT,
UPDATE or DELETE operations performed on a Base table.
</para>
<para>
There are two ways to define integrity constraints:
Table constraint and Column constraint.
</para>
<para>
A Table Constraint is an integrity Constraint defined on one or
more Columns of a Base table. The four variations of "Table
Constraint" are:
<simplelist columns="1">
<member>PRIMARY KEY</member>
<member>FOREIGN KEY</member>
<member>UNIQUE</member>
<member>CHECK</member>
</simplelist>
</para>
<para>
A column constraint is an integrity constraint defined as part
of a column definition, and logically becomes a table
constraint as soon as it is created. The column
constraints available are:
<simplelist columns="1">
<member>PRIMARY KEY</member>
<member>REFERENCES</member>
<member>UNIQUE</member>
<member>CHECK</member>
<member>NOT NULL</member>
</simplelist></para>
<note>
<para>
PostgreSQL does not yet (at release 6.3.2) support the FOREIGN KEY or
REFERENCES integrity constraints, although the parser will accept them.
Foreign keys may be partially emulated by triggers (See CREATE TRIGGER
statement)
</para>
</note>
<note>
<para>
PostgreSQL does not yet support either DOMAINs or ASSERTIONs.
</para>
</note>
</REFSECT2>
<REFSECT2 ID="R2-SQL-CHECK-1">
<REFSECT2INFO>
<DATE>1998-04-15</DATE>
</REFSECT2INFO>
<title>The CHECK constraint</title>
<SYNOPSIS>
[ CONSTRAINT name ] CHECK ( condition [, ...] )
</SYNOPSIS>
<refsect3 id="R3-SQL-CHECK-1">
<title>Inputs</title>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<ReturnValue><replaceable class="parameter">name</replaceable></ReturnValue>
</TERM>
<LISTITEM>
<PARA>
An arbitrary name given to a constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>condition</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
Any valid conditional expression.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</variablelist>
</REFSECT3>
<REFSECT3 ID="R3-SQL-CHECK-2">
<REFSECT3INFO>
<DATE>1998-04-15</DATE>
</REFSECT3INFO>
<TITLE>
Outputs
</TITLE>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<ReturnValue>
ERROR: ExecAppend: rejected due to CHECK constraint
"<replaceable class="parameter">table_column</replaceable>".
</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
This error occurs at runtime if one tries to insert an illegal
value into a column subject to a CHECK constraint.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</variablelist>
</REFSECT3>
<refsect3>
<title>Description</title>
<para>
The CHECK constraint specifies a rule that a group of one or
more columns of a table may contain only those values allowed by
the rule.
The CHECK constraint is either a table constraint or a column
constraint.
</PARA>
<PARA>
PostgreSQL automatically creates an unique index to assure
data integrity (See CREATE INDEX statement).
The SQL92 CHECK column constraints can only be defined on, and
refer to, one column of the table. PostgreSQL does not have
this restriction.
</PARA>
</refsect3>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-PRIMARYKEY-1"> <REFSECT2 ID="R2-SQL-PRIMARYKEY-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
PRIMARY KEY clause PRIMARY KEY Constraint
</TITLE> </TITLE>
<PARA> <para>
Table constraint definition
</PARA>
<SYNOPSIS> <SYNOPSIS>
[ CONSTRAINT <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ] PRIMARY KEY ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) [ CONSTRAINT <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ] PRIMARY KEY ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] )
</SYNOPSIS> </SYNOPSIS>
<PARA>
Column constraint definition
</PARA>
<SYNOPSIS>
[ CONSTRAINT <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ] PRIMARY KEY
</SYNOPSIS>
<refsect3> <refsect3>
<title>Parameters</title> <title>Inputs</title>
<PARA> <PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE></ReturnValue> CONSTRAINT <ReturnValue><REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE></ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -727,19 +1138,27 @@ ...@@ -727,19 +1138,27 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...]
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The name of a column in the table. The names of one or more columns in the table.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</VARIABLELIST> </VARIABLELIST>
</para> </para>
</refsect3> </refsect3>
<refsect3> <refsect3>
<title>Outputs</title> <title>Outputs</title>
<variablelist>
<varlistentry>
<term>
<replaceable>status</replaceable>
</term>
<listitem>
<para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>ERROR: Cannot insert a duplicate key into a unique index.</term> <term>ERROR: Cannot insert a duplicate key into a unique index.</term>
...@@ -750,42 +1169,31 @@ ...@@ -750,42 +1169,31 @@
</PARA> </PARA>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect3> </refsect3>
<refsect3> <refsect3>
<title>Description</title> <title>Description</title>
<PARA> <PARA>
The PRIMARY KEY constraint specifies a rule that a group of one The PRIMARY KEY constraint specifies a rule that a group of one
or more distinct columns of a table may contain only unique, or more distinct columns of a table may contain only unique,
(not duplicates), non-null values. The column definitions of (non duplicate), non-null values. The column definitions of
the specified columns do not have to include a NOT NULL the specified columns do not have to include a NOT NULL
constraint to be included in a PRIMARY KEY constraint. constraint to be included in a PRIMARY KEY constraint.
</PARA>
<PARA> The PRIMARY KEY table constraint is similar to that for column constraints,
A table's set of valid values may be constrained by only one with the additional capability of encompassing multiple columns.
PRIMARY KEY constraint at a time.
</PARA> </PARA>
<PARA> <PARA>
The PRIMARY KEY constraint must name a set of columns that is Refer to the section on the PRIMARY KEY column constraint for more
different from the set of columns named by any UNIQUE constraint information.
defined for the same table.
</PARA>
</REFSECT3> </REFSECT3>
<REFSECT3 ID="R3-SQL-PRIMARYKEY-3">
<REFSECT3INFO>
<DATE>1998-04-15</DATE>
</REFSECT3INFO>
<TITLE>
Notes
</TITLE>
<PARA>
PostgreSQL automatically creates an unique index to assure
data integrity. (See CREATE INDEX statement)
</PARA>
</refsect3>
</REFSECT2> </REFSECT2>
</refsect1> </refsect1>
<REFSECT1 ID="R1-SQL-CREATETABLE-2"> <REFSECT1 ID="R1-SQL-CREATETABLE-2">
...@@ -822,16 +1230,6 @@ ...@@ -822,16 +1230,6 @@
); );
</ProgramListing> </ProgramListing>
<PARA>
Define two NOT NULL column constraints on the table distributors
</PARA>
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3) CONSTRAINT no_null NOT NULL,
name VARCHAR(40) NOT NULL
);
</ProgramListing>
<PARA> <PARA>
Define a UNIQUE table constraint for the table films. Define a UNIQUE table constraint for the table films.
UNIQUE table constraints can be defined on one or more UNIQUE table constraints can be defined on one or more
...@@ -849,26 +1247,6 @@ ...@@ -849,26 +1247,6 @@
); );
</ProgramListing> </ProgramListing>
<PARA>
Defines a UNIQUE column constraint for the table distributors.
UNIQUE column constraints can only be defined on one column
of the table (the following two examples are equivalents).
</PARA>
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(03),
name VARCHAR(40) UNIQUE,
UNIQUE(name)
);
</ProgramListing>
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3),
name VARCHAR(40) UNIQUE
);
</ProgramListing>
<PARA> <PARA>
Define a CHECK column constraint. Define a CHECK column constraint.
</PARA> </PARA>
...@@ -910,7 +1288,7 @@ ...@@ -910,7 +1288,7 @@
<PARA> <PARA>
Defines a PRIMARY KEY column constraint for table distributors. Defines a PRIMARY KEY column constraint for table distributors.
PRIMARY KEY column constraints can only be defined on one column PRIMARY KEY column constraints can only be defined on one column
of the table (the following two examples are equivalents) of the table (the following two examples are equivalent)
</PARA> </PARA>
<ProgramListing> <ProgramListing>
CREATE TABLE distributors ( CREATE TABLE distributors (
...@@ -924,27 +1302,17 @@ ...@@ -924,27 +1302,17 @@
name VARCHAR(40) name VARCHAR(40)
); );
</ProgramListing> </ProgramListing>
<para>
To assign a sequence as the default for the column did,
and a literal to the column name
</PARA>
<ProgramListing>
CREATE TABLE distributors (
did DECIMAL(3) DEFAULT NEXTVAL('serial'),
name VARCHAR(40) DEFAULT 'luso films'
);
</ProgramListing>
<REFSECT2 ID="R2-SQL-CREATETABLE-3"> <REFSECT2 ID="R2-SQL-CREATETABLE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
CREATE TABLE/INHERITS is a PostgreSQL language extension. CREATE TABLE/INHERITS is a <productname>Postgres</productname>
language extension.
</PARA> </PARA>
</refsect2> </refsect2>
...@@ -955,17 +1323,16 @@ ...@@ -955,17 +1323,16 @@
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<REFSECT2 ID="R2-SQL-CREATETABLE-4"> <REFSECT2 ID="R2-SQL-CREATETABLE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
In addition to normal CREATE TABLE, SQL92 also defines a In addition to the normal CREATE TABLE, SQL92 also defines a
CREATE TEMPORARY TABLE statement: CREATE TEMPORARY TABLE statement:
</PARA> </PARA>
<synopsis> <synopsis>
...@@ -996,16 +1363,18 @@ ...@@ -996,16 +1363,18 @@
) ON COMMIT DELETE ROWS ) ON COMMIT DELETE ROWS
</programlisting> </programlisting>
<para> <para>
Temporary tables are not currently available in <productname>Postgres</productname>. Temporary tables are not currently available
in <productname>Postgres</productname>.
<tip> <tip>
<para> <para>
In the current release of <productname>Postgres</productname> (v6.4), to create a temporary In the current release of <productname>Postgres</productname>
(v6.4), to create a temporary
table you must create and drop the table by explicit commands. table you must create and drop the table by explicit commands.
</tip> </tip>
<REFSECT3 ID="R3-SQL-UNIQUECLAUSE-1"> <REFSECT3 ID="R3-SQL-UNIQUECLAUSE-1">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
UNIQUE clause UNIQUE clause
...@@ -1034,7 +1403,7 @@ Temporary tables are not currently available in <productname>Postgres</productna ...@@ -1034,7 +1403,7 @@ Temporary tables are not currently available in <productname>Postgres</productna
<REFSECT3 ID="R3-SQL-NOTNULL-4"> <REFSECT3 ID="R3-SQL-NOTNULL-4">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
NOT NULL clause NOT NULL clause
...@@ -1059,7 +1428,7 @@ the column. Not our problem... ...@@ -1059,7 +1428,7 @@ the column. Not our problem...
<REFSECT3 ID="R3-SQL-DEFAULTCLAUSE-1"> <REFSECT3 ID="R3-SQL-DEFAULTCLAUSE-1">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
DEFAULT clause DEFAULT clause
...@@ -1079,15 +1448,21 @@ the column. Not our problem... ...@@ -1079,15 +1448,21 @@ the column. Not our problem...
<REFSECT3 ID="R3-SQL-CONSTRAINT-3"> <REFSECT3 ID="R3-SQL-CONSTRAINT-3">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
CONSTRAINT clause CONSTRAINT clause
</TITLE> </TITLE>
<PARA> <PARA>
SQL92 specifies some additional capabilities for CONSTRAINTs, SQL92 specifies some additional capabilities for constraints,
and also defines assertions and domain constraints. and also defines assertions and domain constraints.
</PARA> <note>
<para>
<productname>Postgres</productname> does not yet support
either domains or assertions.
</para>
</note>
<PARA> <PARA>
An assertion is a special type of integrity constraint and share An assertion is a special type of integrity constraint and share
the same namespace as other constraints. the same namespace as other constraints.
...@@ -1193,7 +1568,7 @@ the column. Not our problem... ...@@ -1193,7 +1568,7 @@ the column. Not our problem...
<REFSECT3 ID="R3-SQL-CHECK-4"> <REFSECT3 ID="R3-SQL-CHECK-4">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
CHECK clause CHECK clause
...@@ -1257,7 +1632,7 @@ affect a column or a table. ...@@ -1257,7 +1632,7 @@ affect a column or a table.
<REFSECT3 ID="R3-SQL-PRIMARYKEY-1"> <REFSECT3 ID="R3-SQL-PRIMARYKEY-1">
<REFSECT3INFO> <REFSECT3INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-11</DATE>
</REFSECT3INFO> </REFSECT3INFO>
<TITLE> <TITLE>
PRIMARY KEY clause PRIMARY KEY clause
......
...@@ -14,30 +14,24 @@ ...@@ -14,30 +14,24 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
CREATE TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> { BEFORE | AFTER } CREATE TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> { BEFORE | AFTER }
{ <REPLACEABLE CLASS="PARAMETER">event</REPLACEABLE> [OR ...] } { <REPLACEABLE CLASS="PARAMETER">event</REPLACEABLE> [OR ...] }
ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> FOR EACH { ROW | STATEMENT } ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> FOR EACH { ROW | STATEMENT }
EXECUTE PROCEDURE <REPLACEABLE CLASS="PARAMETER">funcname</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">arguments</REPLACEABLE> ) EXECUTE PROCEDURE <REPLACEABLE CLASS="PARAMETER">funcname</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">arguments</REPLACEABLE> )
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-CREATETRIGGER-1"> <REFSECT2 ID="R2-SQL-CREATETRIGGER-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -80,14 +74,11 @@ ...@@ -80,14 +74,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-CREATETRIGGER-2"> <REFSECT2 ID="R2-SQL-CREATETRIGGER-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -97,6 +88,7 @@ ...@@ -97,6 +88,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -120,23 +112,17 @@ ...@@ -120,23 +112,17 @@
<REFSECT1 ID="R1-SQL-CREATETRIGGER-1"> <REFSECT1 ID="R1-SQL-CREATETRIGGER-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
CREATE TRIGGER will enter a new trigger into the current <command>CREATE TRIGGER</command> will enter a new trigger into the current
data base. The trigger will be associated with the relation data base. The trigger will be associated with the relation
<replaceable class="parameter">relname</replaceable> and will execute <replaceable class="parameter">relname</replaceable> and will execute
the specified function <replaceable class="parameter">funcname</replaceable>. the specified function <replaceable class="parameter">funcname</replaceable>.
</PARA> </PARA>
<PARA>
Only the relation owner may create a trigger on this relation.
</PARA>
<PARA>
At release 6.3.2, STATEMENT triggers are not implemented.
</PARA>
<PARA> <PARA>
The trigger can be specified to fire either before the The trigger can be specified to fire either before the
operation is attempted on a tuple (before constraints operation is attempted on a tuple (before constraints
...@@ -147,24 +133,32 @@ ...@@ -147,24 +133,32 @@
skip the operation for the current tuple, or change the tuple skip the operation for the current tuple, or change the tuple
being inserted (for INSERT and UPDATE operations only). If being inserted (for INSERT and UPDATE operations only). If
the trigger fires after the event, all changes, including the the trigger fires after the event, all changes, including the
last INSERTion, UPDATE or DELETion, are "visible" to the trigger. last insertion, update, or deletion, are "visible" to the trigger.
</PARA> </PARA>
<PARA> <PARA>
Refer to the SPI and trigger programming guides for more Refer to the chapters on SPI and Triggers in the
<citetitle>PostgreSQL Programmer's Guide</citetitle> for more
information. information.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-CREATETRIGGER-3"> <REFSECT2 ID="R2-SQL-CREATETRIGGER-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
CREATE TRIGGER statement is a PostgreSQL language extension. <command>CREATE TRIGGER</command> is a <productname>Postgres</productname>
language extension.
</PARA> </PARA>
<PARA>
Only the relation owner may create a trigger on this relation.
</PARA>
<PARA>
As of the current release (v6.4), STATEMENT triggers are not implemented.
</PARA>
<PARA> <PARA>
Refer to the DROP TRIGGER statement for information on how to Refer to <command>DROP TRIGGER</command> for information on how to
remove triggers. remove triggers.
</PARA> </PARA>
...@@ -179,18 +173,18 @@ ...@@ -179,18 +173,18 @@
table before appending or updating a row in the table films: table before appending or updating a row in the table films:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
CREATE TRIGGER if_dist_exists CREATE TRIGGER if_dist_exists
BEFORE INSERT OR UPDATE ON films FOR EACH ROW BEFORE INSERT OR UPDATE ON films FOR EACH ROW
EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did'); EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did');
</ProgramListing> </ProgramListing>
<PARA> <PARA>
Before cancelling a distributor or updating its code, remove every Before cancelling a distributor or updating its code, remove every
reference to the table films: reference to the table films:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
CREATE TRIGGER if_film_exists CREATE TRIGGER if_film_exists
BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW
EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did'); EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did');
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -203,29 +197,30 @@ ...@@ -203,29 +197,30 @@
<REFSECT2 ID="R2-SQL-CREATETRIGGER-4"> <REFSECT2 ID="R2-SQL-CREATETRIGGER-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no CREATE TRIGGER statement in SQL92. There is no <command>CREATE TRIGGER</command> in <acronym>SQL92</acronym>.
</PARA> </PARA>
<PARA> <PARA>
The second example above may also be done by using a FOREIGN KEY The second example above may also be done by using a FOREIGN KEY
constraint as in: constraint as in:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
CREATE TABLE distributors ( CREATE TABLE distributors (
did DECIMAL(3), did DECIMAL(3),
name VARCHAR(40), name VARCHAR(40),
CONSTRAINT if_film_exists FOREIGN KEY(did) REFERENCES films CONSTRAINT if_film_exists
ON UPDATE CASCADE ON DELETE CASCADE FOREIGN KEY(did) REFERENCES films
); ON UPDATE CASCADE ON DELETE CASCADE
);
</ProgramListing> </ProgramListing>
<PARA> <PARA>
However, foreign keys are not yet implemented at version 6.3.2 of However, foreign keys are not yet implemented (as of version 6.4) in
PostgreSQL. <productname>Postgres</productname>.
</PARA> </PARA>
</REFENTRY> </REFENTRY>
......
...@@ -14,46 +14,39 @@ ...@@ -14,46 +14,39 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
CREATE TYPE <replaceable class="parameter">typename</replaceable> ( CREATE TYPE <replaceable class="parameter">typename</replaceable> (
INTERNALLENGTH = (<replaceable class="parameter">internallength</replaceable> | VARIABLE)
[, EXTERNALLENGTH = (<replaceable class="parameter">externallength</replaceable> | VARIABLE) ]
<comment> <comment>
Why are parentheses required around the length parameters? Why are parentheses required around the length parameters?
</comment> </comment>
, INPUT = <replaceable class="parameter">input_function</replaceable> INPUT = <replaceable class="parameter">input_function</replaceable>
, OUTPUT = <replaceable class="parameter">output_function</replaceable> , OUTPUT = <replaceable class="parameter">output_function</replaceable>
[, ELEMENT = <replaceable class="parameter">element</replaceable>] , INTERNALLENGTH = (<replaceable class="parameter">internallength</replaceable> | VARIABLE)
[, DELIMITER = <replaceable class="parameter">delimiter</replaceable>] [ , EXTERNALLENGTH = (<replaceable class="parameter">externallength</replaceable> | VARIABLE) ]
[, DEFAULT = "<replaceable class="parameter">default</replaceable>" ] [ , ELEMENT = <replaceable class="parameter">element</replaceable> ]
[, SEND = <replaceable class="parameter">send_function</replaceable> ] [ , DELIMITER = <replaceable class="parameter">delimiter</replaceable> ]
[, RECEIVE = <replaceable class="parameter">receive_function</replaceable> ] [ , DEFAULT = "<replaceable class="parameter">default</replaceable>" ]
[, PASSEDBYVALUE]) [ , SEND = <replaceable class="parameter">send_function</replaceable> ]
[ , RECEIVE = <replaceable class="parameter">receive_function</replaceable> ]
[ , PASSEDBYVALUE ]
)
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-CREATETYPE-1"> <REFSECT2 ID="R2-SQL-CREATETYPE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>
<replaceable class="parameter">typename</replaceable> <replaceable class="parameter">typename</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -63,9 +56,7 @@ Why are parentheses required around the length parameters? ...@@ -63,9 +56,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue> INTERNALLENGTH <replaceable class="parameter">internallength</replaceable>
<replaceable class="parameter">internallength</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -76,9 +67,7 @@ Why are parentheses required around the length parameters? ...@@ -76,9 +67,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue> EXTERNALLENGTH <replaceable class="parameter">externallength</replaceable>
<replaceable class="parameter">externallength</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -89,9 +78,7 @@ Why are parentheses required around the length parameters? ...@@ -89,9 +78,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue> INPUT <replaceable class="parameter">input_function</replaceable>
<replaceable class="parameter">input_function</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -103,9 +90,7 @@ Why are parentheses required around the length parameters? ...@@ -103,9 +90,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue> OUTPUT <replaceable class="parameter">output_function</replaceable>
<replaceable class="parameter">output_function</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -117,9 +102,7 @@ Why are parentheses required around the length parameters? ...@@ -117,9 +102,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>
<replaceable class="parameter">element</replaceable> <replaceable class="parameter">element</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -130,9 +113,7 @@ Why are parentheses required around the length parameters? ...@@ -130,9 +113,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>
<replaceable class="parameter">delimiter</replaceable> <replaceable class="parameter">delimiter</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -142,9 +123,7 @@ Why are parentheses required around the length parameters? ...@@ -142,9 +123,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>
<replaceable class="parameter">default</replaceable <replaceable class="parameter">default</replaceable
></ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -155,9 +134,7 @@ Why are parentheses required around the length parameters? ...@@ -155,9 +134,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>
<replaceable class="parameter">send_function</replaceable> <replaceable class="parameter">send_function</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -170,9 +147,7 @@ Why are parentheses required around the length parameters? ...@@ -170,9 +147,7 @@ Why are parentheses required around the length parameters?
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>
<replaceable class="parameter">receive_function</replaceable> <replaceable class="parameter">receive_function</replaceable>
</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -184,14 +159,11 @@ Why are parentheses required around the length parameters? ...@@ -184,14 +159,11 @@ Why are parentheses required around the length parameters?
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-CREATETYPE-2"> <REFSECT2 ID="R2-SQL-CREATETYPE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -201,6 +173,7 @@ Why are parentheses required around the length parameters? ...@@ -201,6 +173,7 @@ Why are parentheses required around the length parameters?
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -225,7 +198,7 @@ Why are parentheses required around the length parameters? ...@@ -225,7 +198,7 @@ Why are parentheses required around the length parameters?
<REFSECT1 ID="R1-SQL-CREATETYPE-1"> <REFSECT1 ID="R1-SQL-CREATETYPE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -383,16 +356,19 @@ it with the fact that the data is not present></comment> ...@@ -383,16 +356,19 @@ it with the fact that the data is not present></comment>
</refsect2> </refsect2>
<REFSECT2 ID="R2-SQL-CREATETYPE-3"> <REFSECT2 ID="R2-SQL-CREATETYPE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
Refer to DROP TYPE statement to drop types. Refer to <command>DROP TYPE</command> to remove an existing type.
</PARA> </PARA>
<PARA> <PARA>
See also CREATE FUNCTION, CREATE OPERATOR and large_objects.</para> See also <command>CREATE FUNCTION</command>,
<command>CREATE OPERATOR</command> and the chapter on Large Objects
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>.
</para>
</REFSECT2> </REFSECT2>
</refsect1> </refsect1>
...@@ -402,18 +378,16 @@ it with the fact that the data is not present></comment> ...@@ -402,18 +378,16 @@ it with the fact that the data is not present></comment>
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
CREATE TYPE statement is a PostgreSQL language extension.
</PARA>
<REFSECT2 ID="R2-SQL-CREATETYPE-4"> <REFSECT2 ID="R2-SQL-CREATETYPE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL3 SQL3
</TITLE> </TITLE>
<PARA> <PARA>
CREATE TYPE is a SQL3 statement. <command>CREATE TYPE</command> is an <acronym>SQL3</acronym> statement.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
......
...@@ -14,35 +14,25 @@ ...@@ -14,35 +14,25 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
CREATE USER<REPLACEABLE CLASS="PARAMETER"> username</REPLACEABLE>
CREATE USER<REPLACEABLE CLASS="PARAMETER"> username</REPLACEABLE> [ WITH PASSWORD <REPLACEABLE CLASS="PARAMETER">password</REPLACEABLE> ]
[WITH PASSWORD <REPLACEABLE CLASS="PARAMETER">password</REPLACEABLE>] [ CREATEDB | NOCREATEDB ]
[CREATEDB | NOCREATEDB] [ CREATEUSER | NOCREATEUSER ]
[CREATEUSER | NOCREATEUSER] [ IN GROUP <REPLACEABLE CLASS="PARAMETER">groupname</REPLACEABLE> [, ...] ]
[IN GROUP <REPLACEABLE CLASS="PARAMETER">groupname</REPLACEABLE> [, ...] ] [ VALID UNTIL '<REPLACEABLE CLASS="PARAMETER">abstime</REPLACEABLE>' ]
[VALID UNTIL '<REPLACEABLE CLASS="PARAMETER">abstime</REPLACEABLE>']
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-CREATEUSER-1"> <REFSECT2 ID="R2-SQL-CREATEUSER-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -63,8 +53,8 @@ ...@@ -63,8 +53,8 @@
The WITH PASSWORD clause sets the user's password within The WITH PASSWORD clause sets the user's password within
the "<filename>pg_shadow</filename>" table. For this reason, the "<filename>pg_shadow</filename>" table. For this reason,
<filename>"pg_shadow</filename>" is no <filename>"pg_shadow</filename>" is no
longer accessible to the instance of PostgreSQL that the longer accessible to the instance of <productname>Postgres</productname> that the
PostgreSQL user's password is initially set to NULL. <productname>Postgres</productname> user's password is initially set to NULL.
<comment>The text here has got garbled.</comment> <comment>The text here has got garbled.</comment>
When a When a
user's password in the "<filename>pg_shadow</filename>" user's password in the "<filename>pg_shadow</filename>"
...@@ -72,7 +62,7 @@ ...@@ -72,7 +62,7 @@
authentication proceeds as it historically has (HBA, authentication proceeds as it historically has (HBA,
PG_PASSWORD, etc). However, if a password is set for a PG_PASSWORD, etc). However, if a password is set for a
user, a new authentication system supplants any other user, a new authentication system supplants any other
configured for the PostgreSQL instance, and the password configured for the <productname>Postgres</productname> instance, and the password
stored in the "<filename>pg_shadow</filename>" table is used stored in the "<filename>pg_shadow</filename>" table is used
for authentication. for authentication.
For more details on how this authentication system For more details on how this authentication system
...@@ -105,7 +95,7 @@ ...@@ -105,7 +95,7 @@
<PARA> <PARA>
These clauses determine whether a user will be permitted to These clauses determine whether a user will be permitted to
create new create new
users in an instance of PostgreSQL. users in an instance of <productname>Postgres</productname>.
Omitting this clause will set the user's value of this Omitting this clause will set the user's value of this
attribute to be NOCREATEUSER. attribute to be NOCREATEUSER.
</PARA> </PARA>
...@@ -128,7 +118,7 @@ ...@@ -128,7 +118,7 @@
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The VALID UNTIL clause sets an absolute time after which the The VALID UNTIL clause sets an absolute time after which the
user's PostgreSQL login is no longer valid. Please note that user's <productname>Postgres</productname> login is no longer valid. Please note that
if a user does not have a password defined in the if a user does not have a password defined in the
"<filename>pg_shadow</filename>" "<filename>pg_shadow</filename>"
table, the valid until date will not be checked table, the valid until date will not be checked
...@@ -140,14 +130,11 @@ ...@@ -140,14 +130,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-CREATEUSER-2"> <REFSECT2 ID="R2-SQL-CREATEUSER-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -157,6 +144,7 @@ ...@@ -157,6 +144,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -192,19 +180,20 @@ this error message.</comment> ...@@ -192,19 +180,20 @@ this error message.</comment>
<REFSECT1 ID="R1-SQL-CREATEUSER-1"> <REFSECT1 ID="R1-SQL-CREATEUSER-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
CREATE USER will add a new user to an instance of PostgreSQL. CREATE USER will add a new user to an instance of
<productname>Postgres</productname>.
</PARA> </PARA>
<PARA> <PARA>
The new user will be given a <filename>usesysid</filename> of: The new user will be given a <filename>usesysid</filename> of:
'<command>SELECT MAX(usesysid) + 1 FROM pg_shadow</command>'. '<command>SELECT MAX(usesysid) + 1 FROM pg_shadow</command>'.
This means that This means that
PostgreSQL users' <filename>usesysid</filename>s will not <productname>Postgres</productname> users' <filename>usesysid</filename>s will not
correspond to their operating correspond to their operating
system(OS) user ids. The exception to this rule is system(OS) user ids. The exception to this rule is
the '<literal>postgres</literal>' user, whose OS user id the '<literal>postgres</literal>' user, whose OS user id
...@@ -213,19 +202,19 @@ this error message.</comment> ...@@ -213,19 +202,19 @@ this error message.</comment>
If you still want the If you still want the
OS user id and the <filename>usesysid</filename> to match OS user id and the <filename>usesysid</filename> to match
for any given user, for any given user,
use the "createuser" script provided with the PostgreSQL use the "createuser" script provided with the <productname>Postgres</productname>
distribution. distribution.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-CREATEUSER-3"> <REFSECT2 ID="R2-SQL-CREATEUSER-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
CREATE USER statement is a PostgreSQL language extension. CREATE USER statement is a <productname>Postgres</productname> language extension.
</PARA> </PARA>
<para> <para>
Use DROP USER or ALTER USER statements to remove or modify a user Use DROP USER or ALTER USER statements to remove or modify a user
...@@ -292,7 +281,7 @@ this error message.</comment> ...@@ -292,7 +281,7 @@ this error message.</comment>
<REFSECT2 ID="R2-SQL-CREATEUSER-4"> <REFSECT2 ID="R2-SQL-CREATEUSER-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
......
...@@ -14,28 +14,21 @@ Constructs a virtual table ...@@ -14,28 +14,21 @@ Constructs a virtual table
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
CREATE VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE> CREATE VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
AS SELECT <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE> AS SELECT <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-CREATEVIEW-1"> <REFSECT2 ID="R2-SQL-CREATEVIEW-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -62,14 +55,11 @@ An SQL query which will provide the columns and rows of the view. ...@@ -62,14 +55,11 @@ An SQL query which will provide the columns and rows of the view.
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-CREATEVIEW-2"> <REFSECT2 ID="R2-SQL-CREATEVIEW-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -79,6 +69,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -79,6 +69,7 @@ An SQL query which will provide the columns and rows of the view.
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -133,7 +124,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -133,7 +124,7 @@ An SQL query which will provide the columns and rows of the view.
<REFSECT1 ID="R1-SQL-CREATEVIEW-1"> <REFSECT1 ID="R1-SQL-CREATEVIEW-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -147,7 +138,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -147,7 +138,7 @@ An SQL query which will provide the columns and rows of the view.
<REFSECT2 ID="R2-SQL-CREATEVIEW-3"> <REFSECT2 ID="R2-SQL-CREATEVIEW-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -159,7 +150,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -159,7 +150,7 @@ An SQL query which will provide the columns and rows of the view.
<REFSECT2 ID="R2-SQL-CREATEVIEW-4"> <REFSECT2 ID="R2-SQL-CREATEVIEW-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Bugs Bugs
...@@ -177,17 +168,17 @@ An SQL query which will provide the columns and rows of the view. ...@@ -177,17 +168,17 @@ An SQL query which will provide the columns and rows of the view.
Create a view consisting of all Comedy films: Create a view consisting of all Comedy films:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
CREATE VIEW kinds AS CREATE VIEW kinds AS
SELECT * SELECT *
FROM films FROM films
WHERE kind = 'Comedy'; WHERE kind = 'Comedy';
SELECT * FROM kinds; SELECT * FROM kinds;
code |title |did| date_prod|kind |len code |title |did| date_prod|kind |len
-----+-------------------------+---+----------+----------+------ -----+-------------------------+---+----------+----------+------
UA502|Bananas |105|1971-07-13|Comedy | 01:22 UA502|Bananas |105|1971-07-13|Comedy | 01:22
C_701|There's a Girl in my Soup|107|1970-06-11|Comedy | 01:36 C_701|There's a Girl in my Soup|107|1970-06-11|Comedy | 01:36
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -201,7 +192,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -201,7 +192,7 @@ An SQL query which will provide the columns and rows of the view.
<REFSECT2 ID="R2-SQL-CREATEVIEW-5"> <REFSECT2 ID="R2-SQL-CREATEVIEW-5">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-21</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
...@@ -209,13 +200,13 @@ An SQL query which will provide the columns and rows of the view. ...@@ -209,13 +200,13 @@ An SQL query which will provide the columns and rows of the view.
<PARA> <PARA>
SQL92 specifies some additional capabilities for the CREATE VIEW statement: SQL92 specifies some additional capabilities for the CREATE VIEW statement:
</PARA> </PARA>
<programlisting> <synopsis>
CREATE VIEW <replaceable class="parameter">view</replaceable> [ <replaceable class="parameter">column</replaceable> [, ...] ] CREATE VIEW <replaceable class="parameter">view</replaceable> [ <replaceable class="parameter">column</replaceable> [, ...] ]
AS SELECT <replaceable class="parameter">expression</replaceable> [AS <replaceable class="parameter">colname</replaceable>] [, ...] AS SELECT <replaceable class="parameter">expression</replaceable> [AS <replaceable class="parameter">colname</replaceable>] [, ...]
FROM <replaceable class="parameter">table</replaceable> FROM <replaceable class="parameter">table</replaceable>
[WHERE <replaceable class="parameter">condition</replaceable>] [ WHERE <replaceable class="parameter">condition</replaceable> ]
[ WITH [ CASCADE | LOCAL ] CHECK OPTION ] [ WITH [ CASCADE | LOCAL ] CHECK OPTION ]
</programlisting> </synopsis>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
...@@ -226,7 +217,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -226,7 +217,7 @@ An SQL query which will provide the columns and rows of the view.
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>CHECK OPTION</ReturnValue> CHECK OPTION
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> This option is to do with updatable views. <PARA> This option is to do with updatable views.
...@@ -238,7 +229,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -238,7 +229,7 @@ An SQL query which will provide the columns and rows of the view.
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>LOCAL</ReturnValue> LOCAL
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -248,7 +239,7 @@ An SQL query which will provide the columns and rows of the view. ...@@ -248,7 +239,7 @@ An SQL query which will provide the columns and rows of the view.
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>CASCADE</ReturnValue> CASCADE
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
......
...@@ -259,6 +259,16 @@ and expect data to come back in a text format. ...@@ -259,6 +259,16 @@ and expect data to come back in a text format.
<productname>Postgres</productname> <productname>Postgres</productname>
does not have an explicit <command>OPEN cursor</command> does not have an explicit <command>OPEN cursor</command>
statement; a cursor is considered to be open when it is declared. statement; a cursor is considered to be open when it is declared.
<note>
<para>
In <acronym>SQL92</acronym> cursors are only available in
embedded applications. <application>ecpg</application>, the
embedded SQL preprocessor for <productname>Postgres</productname>,
supports the <acronym>SQL92</acronym> conventions, including those
involving DECLARE and OPEN statements.
</note>
</PARA> </PARA>
</REFSECT2> </REFSECT2>
</refsect1> </refsect1>
...@@ -271,8 +281,8 @@ and expect data to come back in a text format. ...@@ -271,8 +281,8 @@ and expect data to come back in a text format.
To declare a cursor: To declare a cursor:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DECLARE liahona CURSOR DECLARE liahona CURSOR
FOR SELECT * FROM films; FOR SELECT * FROM films;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
......
...@@ -31,16 +31,10 @@ ...@@ -31,16 +31,10 @@
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">table</replaceable></ReturnValue> <replaceable class="parameter">table</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -50,7 +44,7 @@ ...@@ -50,7 +44,7 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">condition</replaceable></ReturnValue> <replaceable class="parameter">condition</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -64,9 +58,6 @@ ...@@ -64,9 +58,6 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DELETE-2"> <REFSECT2 ID="R2-SQL-DELETE-2">
...@@ -81,6 +72,7 @@ ...@@ -81,6 +72,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -97,7 +89,7 @@ ...@@ -97,7 +89,7 @@
</PARA> </PARA>
<PARA> <PARA>
If <replaceable class="parameter">count</replaceable> is 0, If <replaceable class="parameter">count</replaceable> is 0,
no rows are deleted. no rows were deleted.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
...@@ -139,26 +131,27 @@ ...@@ -139,26 +131,27 @@
Remove all films but musicals: Remove all films but musicals:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DELETE FROM films WHERE kind &lt;&gt; 'Musical'; DELETE FROM films WHERE kind &lt;&gt; 'Musical';
SELECT * FROM films; SELECT * FROM films;
code |title |did| date_prod|kind |len code |title |did| date_prod|kind |len
-----+-------------------------+---+----------+----------+------ -----+-------------------------+---+----------+----------+------
UA501|West Side Story |105|1961-01-03|Musical | 02:32 UA501|West Side Story |105|1961-01-03|Musical | 02:32
TC901|The King and I |109|1956-08-11|Musical | 02:13 TC901|The King and I |109|1956-08-11|Musical | 02:13
WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57 WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57
(3 rows)
</ProgramListing> </ProgramListing>
<para> <para>
Clear the table films: Clear the table <literal>films</literal>:
</para> </para>
<programlisting> <programlisting>
DELETE FROM films; DELETE FROM films;
SELECT * FROM films; SELECT * FROM films;
code|title|did|date_prod|kind|len code|title|did|date_prod|kind|len
----+-----+---+---------+----+--- ----+-----+---+---------+----+---
(0 rows) (0 rows)
</programlisting> </programlisting>
</REFSECT1> </REFSECT1>
...@@ -177,14 +170,15 @@ ...@@ -177,14 +170,15 @@
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
SQL92 defines a different syntax for a positioned DELETE statement: <acronym>SQL92</acronym> allows a positioned DELETE statement:
</PARA> </PARA>
<synopsis> <synopsis>
DELETE FROM <replaceable class="parameter">table</replaceable> WHERE CURRENT OF <replaceable class="parameter">cursor</replaceable> DELETE FROM <replaceable class="parameter">table</replaceable> WHERE CURRENT OF <replaceable class="parameter">cursor</replaceable>
</synopsis> </synopsis>
<para> <para>
where <replaceable class="parameter">cursor</replaceable> identifies an open cursor.</para> where <replaceable class="parameter">cursor</replaceable> identifies an open cursor. Interactive cursors in <productname>Postgres</productname> are read-only.
</para>
</refsect2> </refsect2>
</refsect1> </refsect1>
</REFENTRY> </REFENTRY>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<DATE>1998-04-15</DATE> <DATE>1998-04-15</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP AGGREGATE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> DROP AGGREGATE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-1"> <REFSECT2 ID="R2-SQL-DROPAGGREGATE-1">
...@@ -29,16 +29,10 @@ ...@@ -29,16 +29,10 @@
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">name</replaceable></ReturnValue> <replaceable class="parameter">name</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -48,12 +42,12 @@ ...@@ -48,12 +42,12 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">type</replaceable></ReturnValue> <replaceable class="parameter">type</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The type of an existing aggregate function. The type of an existing aggregate function.
(Refer to PostgreSQL User's Guide chapter 4 for (Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for
further information about data types). further information about data types).
<comment>This should become a cross-reference rather than a <comment>This should become a cross-reference rather than a
hard-coded chapter number</comment> hard-coded chapter number</comment>
...@@ -61,9 +55,6 @@ ...@@ -61,9 +55,6 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-2"> <REFSECT2 ID="R2-SQL-DROPAGGREGATE-2">
...@@ -78,6 +69,7 @@ ...@@ -78,6 +69,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -94,7 +86,7 @@ ...@@ -94,7 +86,7 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>WARN RemoveAggregate: aggregate '<replaceable class="parameter">name</replaceable>' for 'type' does not exist</ReturnValue> <ReturnValue>WARN RemoveAggregate: aggregate '<replaceable class="parameter">name</replaceable>' for '<replaceable class="parameter">type</replaceable>' does not exist</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -131,7 +123,8 @@ ...@@ -131,7 +123,8 @@
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP AGGREGATE</command> statement is a PostgreSQL The <command>DROP AGGREGATE</command> statement is a
<productname>Postgres</productname>
language extension. language extension.
</PARA> </PARA>
<PARA> <PARA>
...@@ -150,7 +143,7 @@ ...@@ -150,7 +143,7 @@
<literal>int4</literal>: <literal>int4</literal>:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP AGGREGATE myavg int4; DROP AGGREGATE myavg int4;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -169,7 +162,7 @@ ...@@ -169,7 +162,7 @@
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no DROP AGGREGATE statement in SQL92. There is no DROP AGGREGATE statement in <acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<DATE>1998-04-15</DATE> <DATE>1998-04-15</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> DROP DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPDATABASE-1"> <REFSECT2 ID="R2-SQL-DROPDATABASE-1">
...@@ -29,12 +29,6 @@ ...@@ -29,12 +29,6 @@
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -47,9 +41,6 @@ ...@@ -47,9 +41,6 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPDATABASE-2"> <REFSECT2 ID="R2-SQL-DROPDATABASE-2">
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -88,6 +80,16 @@ ...@@ -88,6 +80,16 @@
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>ERROR: destroydb cannot be executed on an open database</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
This message occurs if the specified database does not exist.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
...@@ -116,17 +118,19 @@ ...@@ -116,17 +118,19 @@
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA>
<warning> <para>
DROP DATABASE statement is a <productname>Postgres</productname>
language extension.
<tip>
<para> <para>
This query should NOT be executed interactively. This query cannot be executed while connected to the target
The <command>destroydb</command> script should be used instead. database. It is usually preferable to use the
<command>destroydb</command> script instead.
</para> </para>
</warning> </tip>
<comment>Some explanation would be desirable here!</comment>
</PARA>
<para>
DROP DATABASE statement is a PostgreSQL language extension.
</para> </para>
<para> <para>
Refer to the <command>CREATE DATABASE</command> statement for Refer to the <command>CREATE DATABASE</command> statement for
...@@ -150,7 +154,7 @@ ...@@ -150,7 +154,7 @@
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no DROP DATABASE statement in SQL92. There is no <command>DROP DATABASE</command> in <acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<DATE>1998-04-15</DATE> <DATE>1998-04-15</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP FUNCTION <replaceable class="parameter">name</replaceable> ( [<replaceable class="parameter">type</replaceable> [, ...]] ) DROP FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] )
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPFUNCTION-1"> <REFSECT2 ID="R2-SQL-DROPFUNCTION-1">
...@@ -30,12 +30,6 @@ ...@@ -30,12 +30,6 @@
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -58,9 +52,6 @@ ...@@ -58,9 +52,6 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPFUNCTION-2"> <REFSECT2 ID="R2-SQL-DROPFUNCTION-2">
...@@ -75,6 +66,7 @@ ...@@ -75,6 +66,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -91,13 +83,12 @@ ...@@ -91,13 +83,12 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue> <ReturnValue>WARN RemoveFunction: Function "<replaceable class="parameter">name</replaceable>" ("<replaceable class="parameter">types</replaceable>") does not exist</ReturnValue>
WARN RemoveFunction: Function "<replaceable class="parameter">name</replaceable>" ("<replaceable class="parameter">types</replaceable>") does not exist</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
This message is given if the function specified does not This message is given if the function specified does not
exist into database. exist in the current database.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
...@@ -131,11 +122,12 @@ exist into database. ...@@ -131,11 +122,12 @@ exist into database.
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
Refer to the <citerefentry> Refer to <citerefentry>
<refentrytitle> <refentrytitle>
CREATE FUNCTION</refentrytitle> CREATE FUNCTION
</refentrytitle>
</citerefentry> </citerefentry>
statement to create aggregate functions. to create aggregate functions.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -147,7 +139,7 @@ exist into database. ...@@ -147,7 +139,7 @@ exist into database.
This command removes the square root function: This command removes the square root function:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP FUNCTION sqrt(int4); DROP FUNCTION sqrt(int4);
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
<REFSECT1 ID="R1-SQL-DROPFUNCTION-3"> <REFSECT1 ID="R1-SQL-DROPFUNCTION-3">
...@@ -164,8 +156,8 @@ exist into database. ...@@ -164,8 +156,8 @@ exist into database.
<TITLE> <TITLE>
Compatibility Compatibility
</TITLE> </TITLE>
<PARA <PARA>
>DROP FUNCTION statement is a PostgreSQL language extension. DROP FUNCTION is a <productname>Postgres</productname> language extension.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-DROPFUNCTION-4"> <REFSECT2 ID="R2-SQL-DROPFUNCTION-4">
...@@ -176,9 +168,10 @@ exist into database. ...@@ -176,9 +168,10 @@ exist into database.
SQL/PSM SQL/PSM
</TITLE> </TITLE>
<PARA> <PARA>
The SQL/PSM DROP FUNCTION statement has the following syntax: SQL/PSM is a proposed standard to enable function extensibility.
The SQL/PSM DROP FUNCTION statement has the following syntax:
<programlisting> <programlisting>
DROP [ SPECIFIC ] FUNCTION <replaceable class="parameter">name</replaceable> { RESTRICT | CASCADE }</programlisting> DROP [ SPECIFIC ] FUNCTION <replaceable class="parameter">name</replaceable> { RESTRICT | CASCADE }</programlisting>
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<DATE>1998-04-15</DATE> <DATE>1998-04-15</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP INDEX <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE> DROP INDEX <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPINDEX-1"> <REFSECT2 ID="R2-SQL-DROPINDEX-1">
...@@ -29,12 +29,6 @@ ...@@ -29,12 +29,6 @@
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -47,9 +41,6 @@ ...@@ -47,9 +41,6 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPINDEX-2"> <REFSECT2 ID="R2-SQL-DROPINDEX-2">
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -84,7 +76,7 @@ ...@@ -84,7 +76,7 @@
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
This message occurs if "<REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>" This message occurs if <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>
is not an index in the database. is not an index in the database.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
...@@ -117,11 +109,12 @@ ...@@ -117,11 +109,12 @@
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
<command>DROP INDEX</command> is a PostgreSQL language extension. <command>DROP INDEX</command> is a <productname>Postgres</productname>
language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE INDEX</command> statement for Refer to the <command>CREATE INDEX</command> statement for
information on how to create indices. information on how to create indexes.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -133,7 +126,7 @@ ...@@ -133,7 +126,7 @@
This command will remove the <literal>title_idx</literal> index: This command will remove the <literal>title_idx</literal> index:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP INDEX title_idx; DROP INDEX title_idx;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -152,9 +145,11 @@ ...@@ -152,9 +145,11 @@
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
SQL92 defines commands by which to access a generic relational database. <acronym>SQL92</acronym> defines commands by which to access
Indices are an implementation-dependent feature and hence a generic relational database.
there is no <command>DROP INDEX</command> statement in SQL92. Indexes are an implementation-dependent feature and hence
there are no index-specific commands or definitions in the
<acronym>SQL92</acronym> language.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<DATE>1998-04-15</DATE> <DATE>1998-04-15</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP PROCEDURAL LANGUAGE '<REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>' DROP PROCEDURAL LANGUAGE '<REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>'
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-1"> <REFSECT2 ID="R2-SQL-DROPLANGUAGE-1">
...@@ -29,16 +29,10 @@ ...@@ -29,16 +29,10 @@
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -47,9 +41,6 @@ ...@@ -47,9 +41,6 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-2"> <REFSECT2 ID="R2-SQL-DROPLANGUAGE-2">
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -107,7 +99,7 @@ ...@@ -107,7 +99,7 @@
</TITLE> </TITLE>
<PARA> <PARA>
<command>DROP PROCEDURAL LANGUAGE</command> will remove the definition <command>DROP PROCEDURAL LANGUAGE</command> will remove the definition
of the previously registered procedural language with the name of the previously registered procedural language having the name
'<replaceable class="parameter">langname</replaceable>'. '<replaceable class="parameter">langname</replaceable>'.
</PARA> </PARA>
...@@ -120,10 +112,10 @@ ...@@ -120,10 +112,10 @@
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP PROCEDURAL LANGUAGE</command> statement is The <command>DROP PROCEDURAL LANGUAGE</command> statement is
a PostgreSQL language extension. a <productname>Postgres</productname> language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE PROCEDURAL LANGUAGE</command> statement Refer to <command>CREATE PROCEDURAL LANGUAGE</command>
for information on how to create procedural languages. for information on how to create procedural languages.
</PARA> </PARA>
</refsect2> </refsect2>
...@@ -153,7 +145,7 @@ ...@@ -153,7 +145,7 @@
This command removes the PL/Sample language: This command removes the PL/Sample language:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP PROCEDURAL LANGUAGE 'plsample' DROP PROCEDURAL LANGUAGE 'plsample'
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -172,7 +164,8 @@ ...@@ -172,7 +164,8 @@
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no DROP PROCEDURAL LANGUAGE statement in SQL92. There is no <command>DROP PROCEDURAL LANGUAGE</command> in
<acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -16,31 +16,25 @@ ...@@ -16,31 +16,25 @@
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP OPERATOR <REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> | NONE [,...] ); DROP OPERATOR <REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> | NONE [,...] )
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPOPERATOR-1"> <REFSECT2 ID="R2-SQL-DROPOPERATOR-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">id</replaceable></ReturnValue> <replaceable class="parameter">id</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -50,7 +44,7 @@ ...@@ -50,7 +44,7 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">type</replaceable></ReturnValue> <replaceable class="parameter">type</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -59,14 +53,11 @@ ...@@ -59,14 +53,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPOPERATOR-2"> <REFSECT2 ID="R2-SQL-DROPOPERATOR-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -76,6 +67,7 @@ ...@@ -76,6 +67,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -92,11 +84,33 @@ ...@@ -92,11 +84,33 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue>ERROR: RemoveOperator: ... does not exist</ReturnValue> <ReturnValue>ERROR: RemoveOperator: binary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type1</REPLACEABLE>' and '<REPLACEABLE CLASS="PARAMETER">type2</REPLACEABLE>' does not exist</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
This message occurs if the specified binary operator does not exist.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>ERROR: RemoveOperator: left unary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>' does not exist</ReturnValue>
</TERM>
<LISTITEM>
<PARA>
This message occurs if the specified left unary operator
specified does not exist.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<ReturnValue>ERROR: RemoveOperator: right unary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>' does not exist</ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
This message occurs if the operator specified doesn't exist. This message occurs if the specified right unary operator
specified does not exist.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
...@@ -109,7 +123,7 @@ ...@@ -109,7 +123,7 @@
<REFSECT1 ID="R1-SQL-DROPOPERATOR-1"> <REFSECT1 ID="R1-SQL-DROPOPERATOR-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -126,22 +140,23 @@ ...@@ -126,22 +140,23 @@
<REFSECT2 ID="R2-SQL-DROPOPERATOR-3"> <REFSECT2 ID="R2-SQL-DROPOPERATOR-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP OPERATOR</command> statement is a PostgreSQL The <command>DROP OPERATOR</command> statement is a
<productname>Postgres</productname>
language extension. language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE OPERATOR</command> statement for Refer to <command>CREATE OPERATOR</command> for
information on how to create operators. information on how to create operators.
</PARA> </PARA>
<PARA> <PARA>
It is the user's responsibility to remove any access methods, It is the user's responsibility to remove any access methods and
operator classes, and so on, that rely on the deleted operator. operator classes that rely on the deleted operator.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -153,20 +168,20 @@ ...@@ -153,20 +168,20 @@
Remove power operator <literal>a^n</literal> for <literal>int4</literal>: Remove power operator <literal>a^n</literal> for <literal>int4</literal>:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP OPERATOR ^ (int4, int4); DROP OPERATOR ^ (int4, int4);
</ProgramListing> </ProgramListing>
<PARA> <PARA>
Remove left unary operator <literal>!a</literal> for booleans: Remove left unary operator <literal>!a</literal> for booleans:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP OPERATOR ! (none, bool); DROP OPERATOR ! (none, bool);
</ProgramListing> </ProgramListing>
<PARA> <PARA>
Remove right unary factorial operator <literal>a!</literal> for Remove right unary factorial operator <literal>a!</literal> for
<literal>int4</literal>: <literal>int4</literal>:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP OPERATOR ! (int4, none); DROP OPERATOR ! (int4, none);
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -179,13 +194,13 @@ ...@@ -179,13 +194,13 @@
<REFSECT2 ID="R2-SQL-DROPOPERATOR-4"> <REFSECT2 ID="R2-SQL-DROPOPERATOR-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no DROP OPERATOR statement in SQL92. There is no <command>DROP OPERATOR</command> in <acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -14,31 +14,25 @@ ...@@ -14,31 +14,25 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP RULE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> DROP RULE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPRULE-1"> <REFSECT2 ID="R2-SQL-DROPRULE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><replaceable class="parameter">name</replaceable></ReturnValue> <replaceable class="parameter">name</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -47,14 +41,11 @@ ...@@ -47,14 +41,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPRULE-2"> <REFSECT2 ID="R2-SQL-DROPRULE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -97,37 +89,40 @@ ...@@ -97,37 +89,40 @@
<REFSECT1 ID="R1-SQL-DROPRULE-1"> <REFSECT1 ID="R1-SQL-DROPRULE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
<command>DROP RULE</command> drops a rule from the specified PostgreSQL rule <command>DROP RULE</command> drops a rule from the specified
system. PostgreSQL will immediately cease enforcing it and <productname>Postgres</productname> rule
system. <productname>Postgres</productname>
will immediately cease enforcing it and
will purge its definition from the system catalogs. will purge its definition from the system catalogs.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-DROPRULE-3"> <REFSECT2 ID="R2-SQL-DROPRULE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP RULE</command> statement is a PostgreSQL The <command>DROP RULE</command> statement is a
<productname>Postgres</productname>
language extension. language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE RULE</command> statement for Refer to <command>CREATE RULE</command> for
information on how to create rules. information on how to create rules.
</PARA> </PARA>
</refsect2> </refsect2>
<REFSECT2 ID="R2-SQL-DROPRULE-4"> <REFSECT2 ID="R2-SQL-DROPRULE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Bugs Bugs
...@@ -160,13 +155,13 @@ ...@@ -160,13 +155,13 @@
<REFSECT2 ID="R2-SQL-DROPRULE-5"> <REFSECT2 ID="R2-SQL-DROPRULE-5">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no DROP RULE statement in SQL92. There is no <command>DROP RULE</command> in SQL92.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -14,31 +14,25 @@ ...@@ -14,31 +14,25 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP SEQUENCE <REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE> [, ...] DROP SEQUENCE <REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE> [, ...]
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-1"> <REFSECT2 ID="R2-SQL-DROPSEQUENCE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -47,14 +41,11 @@ ...@@ -47,14 +41,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-2"> <REFSECT2 ID="R2-SQL-DROPSEQUENCE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -84,7 +76,7 @@ ...@@ -84,7 +76,7 @@
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
This message occurs if the sequence specified does not exist. This message occurs if the specified sequence does not exist.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
...@@ -97,7 +89,7 @@ ...@@ -97,7 +89,7 @@
<REFSECT1 ID="R1-SQL-DROPSEQUENCE-1"> <REFSECT1 ID="R1-SQL-DROPSEQUENCE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -111,13 +103,14 @@ ...@@ -111,13 +103,14 @@
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-3"> <REFSECT2 ID="R2-SQL-DROPSEQUENCE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP SEQUENCE</command> statement is a PostgreSQL The <command>DROP SEQUENCE</command> statement is a
<productname>Postgres</productname>
language extension. language extension.
</PARA> </PARA>
<PARA> <PARA>
...@@ -134,7 +127,7 @@ ...@@ -134,7 +127,7 @@
To remove sequence <literal>serial</literal> from database: To remove sequence <literal>serial</literal> from database:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP SEQUENCE serial DROP SEQUENCE serial
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -147,13 +140,13 @@ ...@@ -147,13 +140,13 @@
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-4"> <REFSECT2 ID="R2-SQL-DROPSEQUENCE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no <command>DROP SEQUENCE</command> statement in SQL92. There is no <command>DROP SEQUENCE</command> in <acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -15,27 +15,21 @@ ...@@ -15,27 +15,21 @@
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [, ...] DROP TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [, ...]
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPTABLE-1"> <REFSECT2 ID="R2-SQL-DROPTABLE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -48,14 +42,11 @@ ...@@ -48,14 +42,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPTABLE-2"> <REFSECT2 ID="R2-SQL-DROPTABLE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -65,6 +56,7 @@ ...@@ -65,6 +56,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -85,7 +77,7 @@ ...@@ -85,7 +77,7 @@
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
If table/view specified doesn't exist into database. If the specified table or view does not exist in the database.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
...@@ -98,32 +90,32 @@ ...@@ -98,32 +90,32 @@
<REFSECT1 ID="R1-SQL-DROPTABLE-1"> <REFSECT1 ID="R1-SQL-DROPTABLE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA><command> <PARA>
</command>DROP TABLE removes tables and views from the database. <command>DROP TABLE</command> removes tables and views from the database.
Only its owner may destroy a table or view. A table Only its owner may destroy a table or view. A table
may be emptied of rows, but not destroyed, by using DELETE. may be emptied of rows, but not destroyed, by using <command>DELETE</command>.
</PARA> </PARA>
<PARA> <PARA>
If a table being destroyed has secondary indices on it, If a table being destroyed has secondary indexes on it,
they will be removed first. The removal of just a they will be removed first. The removal of just a
secondary index will not affect the indexed table. secondary index will not affect the contents of the underlying table.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-DROPTABLE-3"> <REFSECT2 ID="R2-SQL-DROPTABLE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
Refer to the <command>CREATE TABLE</command> and Refer to <command>CREATE TABLE</command> and
<command>ALTER TABLE</command> statements for information on <command>ALTER TABLE</command> for information on
how to create or modify tables. how to create or modify tables.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -138,7 +130,7 @@ ...@@ -138,7 +130,7 @@
<command>distributors</command> tables: <command>distributors</command> tables:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP TABLE films, distributors DROP TABLE films, distributors
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -151,7 +143,7 @@ ...@@ -151,7 +143,7 @@
<REFSECT2 ID="R2-SQL-DROPTABLE-4"> <REFSECT2 ID="R2-SQL-DROPTABLE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
...@@ -160,7 +152,7 @@ ...@@ -160,7 +152,7 @@
SQL92 specifies some additional capabilities for DROP TABLE: SQL92 specifies some additional capabilities for DROP TABLE:
</PARA> </PARA>
<synopsis> <synopsis>
DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE } DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
</synopsis> </synopsis>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -185,7 +177,7 @@ ...@@ -185,7 +177,7 @@
<tip> <tip>
<para> <para>
At present, to remove a referenced view you must drop At present, to remove a referenced view you must drop
it by hand. it explicitly.
</para> </para>
</tip> </tip>
</refsect2> </refsect2>
......
...@@ -14,31 +14,25 @@ ...@@ -14,31 +14,25 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> DROP TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPTRIGGER-1"> <REFSECT2 ID="R2-SQL-DROPTRIGGER-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -48,7 +42,7 @@ ...@@ -48,7 +42,7 @@
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -57,14 +51,11 @@ ...@@ -57,14 +51,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPTRIGGER-2"> <REFSECT2 ID="R2-SQL-DROPTRIGGER-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -74,6 +65,7 @@ ...@@ -74,6 +65,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -108,7 +100,7 @@ ...@@ -108,7 +100,7 @@
<REFSECT1 ID="R1-SQL-DROPTRIGGER-1"> <REFSECT1 ID="R1-SQL-DROPTRIGGER-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -121,17 +113,17 @@ ...@@ -121,17 +113,17 @@
<REFSECT2 ID="R2-SQL-DROPTRIGGER-3"> <REFSECT2 ID="R2-SQL-DROPTRIGGER-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP TRIGGER</command> statement is a PostgreSQL <command>DROP TRIGGER</command> is a <productname>Postgres</productname>
language extension. language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE TRIGGER</command> statement for Refer to <command>CREATE TRIGGER</command> for
information on how to create triggers. information on how to create triggers.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -141,10 +133,11 @@ ...@@ -141,10 +133,11 @@
Usage Usage
</TITLE> </TITLE>
<PARA> <PARA>
Destroy the <literal>if_dist_exists</literal> trigger on table <literal>films</literal>: Destroy the <literal>if_dist_exists</literal> trigger
on table <literal>films</literal>:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP TRIGGER if_dist_exists ON films; DROP TRIGGER if_dist_exists ON films;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -157,13 +150,14 @@ ...@@ -157,13 +150,14 @@
<REFSECT2 ID="R2-SQL-DROPTRIGGER-4"> <REFSECT2 ID="R2-SQL-DROPTRIGGER-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no <command>DROP TRIGGER</command> statement in SQL92. There is no <command>DROP TRIGGER</command> statement in
<acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -14,31 +14,25 @@ ...@@ -14,31 +14,25 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP TYPE <REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE> DROP TYPE <REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPTYPE-1"> <REFSECT2 ID="R2-SQL-DROPTYPE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -47,14 +41,11 @@ ...@@ -47,14 +41,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPTYPE-2"> <REFSECT2 ID="R2-SQL-DROPTYPE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -97,7 +89,7 @@ ...@@ -97,7 +89,7 @@
<REFSECT1 ID="R1-SQL-DROPTYPE-1"> <REFSECT1 ID="R1-SQL-DROPTYPE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -112,28 +104,29 @@ ...@@ -112,28 +104,29 @@
<REFSECT2 ID="R2-SQL-DROPTYPE-3"> <REFSECT2 ID="R2-SQL-DROPTYPE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
DROP TYPE statement is a PostgreSQL language extension. DROP TYPE statement is a <productname>Postgres</productname>
language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE TYPE</command> statement for Refer to <command>CREATE TYPE</command> for
inforamation on how to create types. inforamation on how to create types.
</PARA> </PARA>
<PARA> <PARA>
It is the user's responsibility to remove any operators, It is the user's responsibility to remove any operators,
functions, aggregates, access methods, subtypes, classes, functions, aggregates, access methods, subtypes, and classes
and so on, that use a deleted type. that use a deleted type.
</PARA> </PARA>
</refsect2> </refsect2>
<REFSECT2 ID="R2-SQL-DROPTYPE-4"> <REFSECT2 ID="R2-SQL-DROPTYPE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Bugs Bugs
...@@ -152,7 +145,7 @@ ...@@ -152,7 +145,7 @@
To remove the <literal>box</literal> type: To remove the <literal>box</literal> type:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP TYPE box DROP TYPE box
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -165,13 +158,13 @@ ...@@ -165,13 +158,13 @@
<REFSECT2 ID="R2-SQL-DROPTYPE-5"> <REFSECT2 ID="R2-SQL-DROPTYPE-5">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL3 SQL3
</TITLE> </TITLE>
<PARA> <PARA>
DROP TYPE is a SQL3 statement. DROP TYPE is a <acronym>SQL3</acronym> statement.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -15,31 +15,25 @@ ...@@ -15,31 +15,25 @@
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP USER <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE> DROP USER <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPUSER-1"> <REFSECT2 ID="R2-SQL-DROPUSER-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -48,14 +42,11 @@ ...@@ -48,14 +42,11 @@
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPUSER-2"> <REFSECT2 ID="R2-SQL-DROPUSER-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -65,6 +56,7 @@ ...@@ -65,6 +56,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -98,35 +90,35 @@ ...@@ -98,35 +90,35 @@
<REFSECT1 ID="R1-SQL-DROPUSER-1"> <REFSECT1 ID="R1-SQL-DROPUSER-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP USER</command> statement removes the named <command>DROP USER</command> removes the specified
user from the database, user from the database,
along with any databases owned by the user. It along with any databases owned by the user. It
does not remove tables, views, or triggers owned by the does not remove tables, views, or triggers owned by the
named user in databases not owned by the user. This statement named user in databases not owned by the user. This statement
can be used in the place of the <command>destroyuser</command> can be used in place of the <application>destroyuser</application>
script, regardless of how the user was created. script, regardless of how the user was created.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-DROPUSER-3"> <REFSECT2 ID="R2-SQL-DROPUSER-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The <command>DROP USER</command> statement is a PostgreSQL <command>DROP USER</command> is a <productname>Postgres</productname>
language extension. language extension.
</PARA> </PARA>
<PARA> <PARA>
Refer to the <command>CREATE USER</command> and Refer to <command>CREATE USER</command> and
<command>ALTER USER</command> statements for information on <command>ALTER USER</command> for information on
how to create or modify user accounts. how to create or modify user accounts.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -139,7 +131,7 @@ ...@@ -139,7 +131,7 @@
To drop a user account: To drop a user account:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP USER Jonathan; DROP USER Jonathan;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -152,13 +144,13 @@ ...@@ -152,13 +144,13 @@
<REFSECT2 ID="R2-SQL-DROPUSER-4"> <REFSECT2 ID="R2-SQL-DROPUSER-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no <command>DROP USER</command> statement in SQL92. There is no <command>DROP USER</command> in <acronym>SQL92</acronym>.
</PARA> </PARA>
</refsect2> </refsect2>
</refsect1> </refsect1>
......
...@@ -14,47 +14,38 @@ ...@@ -14,47 +14,38 @@
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
DROP VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE> DROP VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-DROPVIEW-1"> <REFSECT2 ID="R2-SQL-DROPVIEW-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA> </PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<ReturnValue><REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE></ReturnValue> <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
The name of an existing view to drop. The name of an existing view.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
</variablelist> </variablelist>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
<REFSECT2 ID="R2-SQL-DROPVIEW-2"> <REFSECT2 ID="R2-SQL-DROPVIEW-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -64,6 +55,7 @@ ...@@ -64,6 +55,7 @@
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
<replaceable>status</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -99,7 +91,7 @@ ...@@ -99,7 +91,7 @@
<REFSECT1 ID="R1-SQL-DROPVIEW-1"> <REFSECT1 ID="R1-SQL-DROPVIEW-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -112,16 +104,18 @@ ...@@ -112,16 +104,18 @@
<REFSECT2 ID="R2-SQL-DROPVIEW-3"> <REFSECT2 ID="R2-SQL-DROPVIEW-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The PostgreSQL <command>DROP TABLE</command> statement also drops views. The <productname>Postgres</productname>
<command>DROP TABLE</command> statement also drops views.
</PARA> </PARA>
<PARA> <PARA>
Refer to the<command> CREATE VIEW</command> statement for information on how to create views. Refer to <command>CREATE VIEW</command>
for information on how to create views.
</PARA> </PARA>
</REFSECT2> </REFSECT2>
...@@ -133,7 +127,7 @@ ...@@ -133,7 +127,7 @@
This command will remove the view called <literal>kinds</literal>: This command will remove the view called <literal>kinds</literal>:
</PARA> </PARA>
<ProgramListing> <ProgramListing>
DROP VIEW kinds DROP VIEW kinds;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -146,19 +140,28 @@ ...@@ -146,19 +140,28 @@
<REFSECT2 ID="R2-SQL-DROPVIEW-4"> <REFSECT2 ID="R2-SQL-DROPVIEW-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-22</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
SQL92 specifies some additional capabilities for <acronym>SQL92</acronym> specifies some additional capabilities for
<command>DROP VIEW</command>: <command>DROP VIEW</command>:
</PARA> </PARA>
<synopsis> <synopsis>
DROP VIEW <replaceable class="parameter">view</replaceable> {RESTRICT | CASCADE} DROP VIEW <replaceable class="parameter">view</replaceable> { RESTRICT | CASCADE }
</synopsis> </synopsis>
<REFSECT3 ID="R3-SQL-DROPVIEW-1">
<REFSECT3INFO>
<DATE>1998-09-22</DATE>
</REFSECT3INFO>
<TITLE>
Inputs
</TITLE>
<PARA>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>RESTRICT</term> <term>RESTRICT</term>
...@@ -179,10 +182,21 @@ ...@@ -179,10 +182,21 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</refsect3>
<REFSECT3 ID="R3-SQL-DROPVIEW-2">
<REFSECT3INFO>
<DATE>1998-09-22</DATE>
</REFSECT3INFO>
<TITLE>
Notes
</TITLE>
<para>
<tip> <tip>
<para> <para>
At present, to remove a referenced view from a PostgreSQL database, At present, to remove a referenced view from a
you must drop it by hand. <productname>Postgres</productname> database,
you must drop it explicitly.
</para> </para>
</tip> </tip>
</refsect2> </refsect2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment