Commit f8b6b5f1 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Cleanup markup and minor editing to prepare for first release.

parent dcff8232
...@@ -1663,6 +1663,102 @@ affect a column or a table. ...@@ -1663,6 +1663,102 @@ affect a column or a table.
</refsect1> </refsect1>
</refentry> </refentry>
<REFENTRY ID="SQL-CREATETABLEAS">
<REFMETA>
<REFENTRYTITLE>
CREATE TABLE
</REFENTRYTITLE>
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
</REFMETA>
<REFNAMEDIV>
<REFNAME>
CREATE TABLE
</REFNAME>
<REFPURPOSE>
Creates a new table
</REFPURPOSE>
<REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO>
<DATE>1998-09-22</DATE>
</REFSYNOPSISDIVINFO>
<SYNOPSIS>
CREATE TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ] AS <REPLACEABLE CLASS="PARAMETER">select_clause</REPLACEABLE>
</SYNOPSIS>
<REFSECT2 ID="R2-SQL-CREATETABLEAS-1">
<REFSECT2INFO>
<DATE>1998-09-22</DATE>
</REFSECT2INFO>
<TITLE>
Inputs
</TITLE>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
The name of a new table to be created.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
The name of a column. Multiple column names can be specified using
a comma-delimited list of column names.
</PARA>
</LISTITEM>
</VARLISTENTRY>
<VARLISTENTRY>
<TERM>
<REPLACEABLE CLASS="PARAMETER">select_clause</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
A valid query statement. Refer to SELECT for a description of the
allowed syntax.
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<REFSECT2 ID="R2-SQL-CREATETABLEAS-2">
<REFSECT2INFO>
<DATE>1998-09-22</DATE>
</REFSECT2INFO>
<TITLE>
Outputs
</TITLE>
<PARA>
Refer to CREATE TABLE and SELECT for a summary of possible output
messages.
<REFSECT1 ID="R1-SQL-CREATETABLEAS-1">
<REFSECT1INFO>
<DATE>1998-09-22</DATE>
</REFSECT1INFO>
<TITLE>
Description
</TITLE>
<PARA>
CREATE TABLE AS enables a table to be created from the contents of
an existing table. It has functionality equivalent to SELECT TABLE INTO,
but with perhaps a more obvious syntax.
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
......
...@@ -10,7 +10,7 @@ EXPLAIN ...@@ -10,7 +10,7 @@ EXPLAIN
EXPLAIN EXPLAIN
</REFNAME> </REFNAME>
<REFPURPOSE> <REFPURPOSE>
Shows statement execution details. Shows statement execution details
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
...@@ -64,11 +64,19 @@ Outputs ...@@ -64,11 +64,19 @@ Outputs
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
NOTICE: QUERY PLAN: NOTICE: QUERY PLAN:
<replaceable>plan</replaceable>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Explicit query plan from the <productname>Postgres</productname> backend. Explicit query plan from the <productname>Postgres</productname> backend.
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
EXPLAIN EXPLAIN
...@@ -77,6 +85,7 @@ EXPLAIN ...@@ -77,6 +85,7 @@ EXPLAIN
<PARA> <PARA>
Flag sent after query plan is shown. Flag sent after query plan is shown.
</VARIABLELIST>
</VARIABLELIST> </VARIABLELIST>
</REFSECT2> </REFSECT2>
...@@ -102,6 +111,13 @@ Description ...@@ -102,6 +111,13 @@ Description
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
There is only sparse documentation on the optimizer's use of cost
information in <productname>Postgres</productname>.
General information on cost estimation for query optimization
can be found in database textbooks.
Refer to the <citetitle>Programmer's Guide</citetitle>
in the chapters on indexes and the genetic query optimizer for
more information.
</REFSECT2> </REFSECT2>
......
...@@ -146,7 +146,8 @@ NOTICE: PerformPortalFetch: portal "<REPLACEABLE CLASS="PARAMETER">cursor</REPL ...@@ -146,7 +146,8 @@ NOTICE: PerformPortalFetch: portal "<REPLACEABLE CLASS="PARAMETER">cursor</REPL
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
If <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE> is not previously declared. If <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
is not previously declared.
The cursor must be declared within a transaction block. The cursor must be declared within a transaction block.
<VARLISTENTRY> <VARLISTENTRY>
...@@ -293,6 +294,9 @@ Usage ...@@ -293,6 +294,9 @@ Usage
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
The non-embedded use of cursors is a <productname>Postgres</productname>
extension. The syntax and usage of cursors is being compared
against the embedded form of cursors defined in <acronym>SQL92</acronym>.
</PARA> </PARA>
<REFSECT2 ID="R2-SQL-FETCH-4"> <REFSECT2 ID="R2-SQL-FETCH-4">
...@@ -303,7 +307,7 @@ Compatibility ...@@ -303,7 +307,7 @@ Compatibility
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
SQL92 allows absolute positioning of the cursor for <acronym>SQL92</acronym> allows absolute positioning of the cursor for
FETCH, and allows placing the results into explicit variables. FETCH, and allows placing the results into explicit variables.
<synopsis> <synopsis>
......
...@@ -15,7 +15,7 @@ Grants access privilege to a user, a group or all users ...@@ -15,7 +15,7 @@ Grants access privilege to a user, a group or all users
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-23</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...] GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...]
...@@ -25,7 +25,7 @@ GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...] ...@@ -25,7 +25,7 @@ GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...]
<REFSECT2 ID="R2-SQL-GRANT-1"> <REFSECT2 ID="R2-SQL-GRANT-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
...@@ -147,13 +147,21 @@ representing all users. ...@@ -147,13 +147,21 @@ representing all users.
<REFSECT2 ID="R2-SQL-GRANT-2"> <REFSECT2 ID="R2-SQL-GRANT-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -175,13 +183,14 @@ if it is impossible ...@@ -175,13 +183,14 @@ if it is impossible
to give privileges to the specified group or users. to give privileges to the specified group or users.
</VARIABLELIST> </VARIABLELIST>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
</REFSYNOPSISDIV> </REFSYNOPSISDIV>
<REFSECT1 ID="R1-SQL-GRANT-1"> <REFSECT1 ID="R1-SQL-GRANT-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-23</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -202,7 +211,7 @@ There is no need to GRANT privileges to the creator of ...@@ -202,7 +211,7 @@ There is no need to GRANT privileges to the creator of
<REFSECT2 ID="R2-SQL-GRANT-3"> <REFSECT2 ID="R2-SQL-GRANT-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -235,8 +244,8 @@ Use the <command>psql \z</command> command ...@@ -235,8 +244,8 @@ Use the <command>psql \z</command> command
Currently, to create a GROUP you have to insert Currently, to create a GROUP you have to insert
data manually into table pg_group as: data manually into table pg_group as:
<programlisting> <programlisting>
INSERT INTO pg_group VALUES ('todos'); INSERT INTO pg_group VALUES ('todos');
CREATE USER miriam IN GROUP todos; CREATE USER miriam IN GROUP todos;
</programlisting> </programlisting>
Refer to REVOKE statements to revoke access privileges. Refer to REVOKE statements to revoke access privileges.
</tip> </tip>
...@@ -249,15 +258,15 @@ Usage ...@@ -249,15 +258,15 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
-- grant insert privilege to all users on table films: -- grant insert privilege to all users on table films:
-- --
GRANT INSERT ON films TO PUBLIC; GRANT INSERT ON films TO PUBLIC;
</programlisting> </programlisting>
<programlisting> <programlisting>
-- grant all privileges to user manuel on view kinds: -- grant all privileges to user manuel on view kinds:
-- --
GRANT ALL ON kinds TO manuel; GRANT ALL ON kinds TO manuel;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -271,13 +280,13 @@ Compatibility ...@@ -271,13 +280,13 @@ Compatibility
<REFSECT2 ID="R2-SQL-GRANT-4"> <REFSECT2 ID="R2-SQL-GRANT-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
The SQL92 syntax for GRANT allows setting privileges The <acronym>SQL92</acronym> syntax for GRANT allows setting privileges
for individual columns for individual columns
within a table, and allows setting a privilege to grant within a table, and allows setting a privilege to grant
the same privileges to others. the same privileges to others.
......
...@@ -14,7 +14,7 @@ Inserts new rows into a table ...@@ -14,7 +14,7 @@ Inserts new rows into a table
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-02</DATE> <DATE>1998-09-23</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
INSERT INTO <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ] INSERT INTO <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ]
...@@ -23,7 +23,7 @@ INSERT INTO <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE ...@@ -23,7 +23,7 @@ INSERT INTO <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE
<REFSECT2 ID="R2-SQL-INSERT-1"> <REFSECT2 ID="R2-SQL-INSERT-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
...@@ -70,33 +70,42 @@ A valid query. Refer to the SELECT statement for a further description ...@@ -70,33 +70,42 @@ A valid query. Refer to the SELECT statement for a further description
<REFSECT2 ID="R2-SQL-INSERT-2"> <REFSECT2 ID="R2-SQL-INSERT-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
INSERT <ReturnValue>oid</ReturnValue> 1 <replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<ReturnValue>INSERT <replaceable>oid</replaceable></ReturnValue> 1
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned if only one row was inserted. Message returned if only one row was inserted.
<ReturnValue>oid</ReturnValue> is the row identifier. <ReturnValue><replaceable>oid</replaceable></ReturnValue>
is the row identifier.
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
INSERT 0 <ReturnValue>#</ReturnValue> <ReturnValue>INSERT 0 <replaceable>#</replaceable></ReturnValue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned if more than one rows were inserted. Message returned if more than one rows were inserted.
<ReturnValue>#</ReturnValue> is the number of rows inserted. <ReturnValue><replaceable>#</replaceable></ReturnValue>
is the number of rows inserted.
</VARIABLELIST> </VARIABLELIST>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
</REFSYNOPSISDIV> </REFSYNOPSISDIV>
...@@ -129,45 +138,45 @@ Usage ...@@ -129,45 +138,45 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
--Insert a single row into table films; --Insert a single row into table films;
--(in the second example the column date_prod is omitted --(in the second example the column date_prod is omitted
--therefore will be stored in it a default value of NULL): --therefore will be stored in it a default value of NULL):
-- --
INSERT INTO films VALUES INSERT INTO films VALUES
('UA502','Bananas',105,'1971-07-13','Comedy',INTERVAL '82 minute'); ('UA502','Bananas',105,'1971-07-13','Comedy',INTERVAL '82 minute');
INSERT INTO films (code, title, did, date_prod, kind) INSERT INTO films (code, title, did, date_prod, kind)
VALUES ('T_601', 'Yojimbo', 106, DATE '1961-06-16', 'Drama'); VALUES ('T_601', 'Yojimbo', 106, DATE '1961-06-16', 'Drama');
</ProgramListing> </ProgramListing>
<ProgramListing> <ProgramListing>
--Insert a single row into table distributors, note that --Insert a single row into table distributors, note that
--only column "name" is specified, to the non specified --only column "name" is specified, to the non specified
--column "did" will be assigned its default value: --column "did" will be assigned its default value:
-- --
INSERT INTO distributors (name) VALUES ('British Lion'); INSERT INTO distributors (name) VALUES ('British Lion');
</ProgramListing> </ProgramListing>
<ProgramListing> <ProgramListing>
--Insert several rows into table films from table tmp: --Insert several rows into table films from table tmp:
-- --
INSERT INTO films INSERT INTO films
SELECT * FROM tmp; SELECT * FROM tmp;
</ProgramListing> </ProgramListing>
<ProgramListing> <ProgramListing>
--Insert into arrays: --Insert into arrays:
--Create an empty 3x3 gameboard for noughts-and-crosses --Create an empty 3x3 gameboard for noughts-and-crosses
--(all of these queries create the same board attribute) --(all of these queries create the same board attribute)
--(Refer to PostgreSQL User's Guide chapter 7 for further --(Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for further
--information about arrays). --information about arrays).
INSERT INTO tictactoe (game, board[1:3][1:3]) INSERT INTO tictactoe (game, board[1:3][1:3])
VALUES (1,'{{"","",""},{},{"",""}}'); VALUES (1,'{{"","",""},{},{"",""}}');
INSERT INTO tictactoe (game, board[3][3]) INSERT INTO tictactoe (game, board[3][3])
VALUES (2,'{}'); VALUES (2,'{}');
INSERT INTO tictactoe (game, board) INSERT INTO tictactoe (game, board)
VALUES (3,'{{,,},{,,},{,,}}'); VALUES (3,'{{,,},{,,},{,,}}');
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -181,7 +190,7 @@ Compatibility ...@@ -181,7 +190,7 @@ Compatibility
<REFSECT2 ID="R2-SQL-INSERT-4"> <REFSECT2 ID="R2-SQL-INSERT-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-23</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
......
...@@ -15,7 +15,7 @@ Listen for notification on a relation ...@@ -15,7 +15,7 @@ Listen for notification on a relation
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
LISTEN <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE> LISTEN <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE>
...@@ -45,13 +45,20 @@ Table object used for notification. ...@@ -45,13 +45,20 @@ Table object used for notification.
<REFSECT2 ID="R2-SQL-LISTEN-2"> <REFSECT2 ID="R2-SQL-LISTEN-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -61,6 +68,7 @@ LISTEN ...@@ -61,6 +68,7 @@ LISTEN
<PARA> <PARA>
Message returned upon successful completion of registration. Message returned upon successful completion of registration.
</VARIABLELIST>
</VARIABLELIST> </VARIABLELIST>
</REFSECT2> </REFSECT2>
...@@ -68,7 +76,7 @@ Message returned upon successful completion of registration. ...@@ -68,7 +76,7 @@ Message returned upon successful completion of registration.
<REFSECT1 ID="R1-SQL-LISTEN-1"> <REFSECT1 ID="R1-SQL-LISTEN-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -95,15 +103,15 @@ never be processed. ...@@ -95,15 +103,15 @@ never be processed.
<REFSECT2 ID="R2-SQL-LISTEN-3"> <REFSECT2 ID="R2-SQL-LISTEN-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<para> <para>
Note that <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE> Note that <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE>
needs not to be a valid class name but can be any string valid as a name up to 32 needs not to be a valid class name but can be any string valid
characters long. as a name up to 32 characters long.
<para> <para>
A restriction in some previous releases of A restriction in some previous releases of
...@@ -134,7 +142,6 @@ ASYNC NOTIFY of 'virtual' from backend pid '11239' received ...@@ -134,7 +142,6 @@ ASYNC NOTIFY of 'virtual' from backend pid '11239' received
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<REFSECT2 ID="R2-SQL-LISTEN-4"> <REFSECT2 ID="R2-SQL-LISTEN-4">
<REFSECT2INFO> <REFSECT2INFO>
...@@ -144,5 +151,5 @@ Compatibility ...@@ -144,5 +151,5 @@ Compatibility
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no LISTEN statement in <acronym>SQL92</acronym>. There is no <command>LISTEN</command> in <acronym>SQL92</acronym>.
</REFENTRY> </REFENTRY>
...@@ -15,7 +15,7 @@ Dynamically loads an object file ...@@ -15,7 +15,7 @@ Dynamically loads an object file
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
<REPLACEABLE CLASS="PARAMETER"> <REPLACEABLE CLASS="PARAMETER">
...@@ -47,21 +47,41 @@ Object file for dynamic loading. ...@@ -47,21 +47,41 @@ Object file for dynamic loading.
<REFSECT2 ID="R2-SQL-LOAD-2"> <REFSECT2 ID="R2-SQL-LOAD-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
LOAD <replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<returnvalue>LOAD</returnvalue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned on successful completion.
<VARLISTENTRY>
<TERM>
<returnvalue>ERROR: LOAD: could not open file '<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>'</returnvalue>
</TERM>
<LISTITEM>
<PARA>
Message returned if the specified file is not found. The file must be visible
<emphasis>to the <productname>Postgres</productname> backend</emphasis>,
with the appropriate full path name specified, to avoid this message.
</VARIABLELIST>
</VARIABLELIST> </VARIABLELIST>
</REFSECT2> </REFSECT2>
...@@ -69,7 +89,7 @@ LOAD ...@@ -69,7 +89,7 @@ LOAD
<REFSECT1 ID="R1-SQL-LOAD-1"> <REFSECT1 ID="R1-SQL-LOAD-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -78,7 +98,7 @@ Description ...@@ -78,7 +98,7 @@ Description
Loads an object (or ".o") file into the Loads an object (or ".o") file into the
<productname>Postgres</productname> backend address space. Once a <productname>Postgres</productname> backend address space. Once a
file is loaded, all functions in that file can be accessed. This file is loaded, all functions in that file can be accessed. This
function is used in support of ADT's. function is used in support of user-defined types and functions.
<para> <para>
If a file is not loaded using If a file is not loaded using
...@@ -92,7 +112,7 @@ at this time. ...@@ -92,7 +112,7 @@ at this time.
<REFSECT2 ID="R2-SQL-LOAD-3"> <REFSECT2 ID="R2-SQL-LOAD-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -101,12 +121,14 @@ Notes ...@@ -101,12 +121,14 @@ Notes
Functions in loaded object files should not call functions in other Functions in loaded object files should not call functions in other
object files loaded through the object files loaded through the
<command>LOAD</command> <command>LOAD</command>
command, meaning, for example, that all functions in file A should command. For example, all functions in file <literal>A</literal> should
call each other, functions in the standard or math libraries, or in call each other, functions in the standard or math libraries, or in
Postgres itself. They should not call functions defined in a different Postgres itself. They should not call functions defined in a different
loaded file B. This is because if B is reloaded, the Postgres loader is loaded file <literal>B</literal>.
not able to relocate the calls from the functions in A into This is because if <literal>B</literal> is reloaded, the Postgres loader is
the new address space of B. If B is not reloaded, however, there will not able to relocate the calls from the functions in <literal>A</literal> into
the new address space of <literal>B</literal>.
If <literal>B</literal> is not reloaded, however, there will
not be a problem. not be a problem.
<para> <para>
...@@ -114,7 +136,7 @@ Object files must be compiled to contain position independent code. ...@@ -114,7 +136,7 @@ Object files must be compiled to contain position independent code.
For example, For example,
on DECstations you must use on DECstations you must use
<application>/bin/cc</application> <application>/bin/cc</application>
with the "-G 0" option when compiling object files to be with the <literal>-G 0</literal> option when compiling object files to be
loaded. loaded.
<para> <para>
...@@ -130,9 +152,9 @@ Usage ...@@ -130,9 +152,9 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
--Load the file /usr/postgres/demo/circle.o --Load the file /usr/postgres/demo/circle.o
-- --
LOAD "/usr/postgres/demo/circle.o" LOAD "/usr/postgres/demo/circle.o"
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -146,12 +168,12 @@ Compatibility ...@@ -146,12 +168,12 @@ Compatibility
<REFSECT2 ID="R2-SQL-LOAD-4"> <REFSECT2 ID="R2-SQL-LOAD-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no LOAD statement in <acronym>SQL92</acronym>. There is no <command>LOAD</command> in <acronym>SQL92</acronym>.
</REFENTRY> </REFENTRY>
...@@ -15,10 +15,10 @@ Explicit lock of a table inside a transaction ...@@ -15,10 +15,10 @@ Explicit lock of a table inside a transaction
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
LOCK [TABLE] <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> LOCK [ TABLE ] <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-LOCK-1"> <REFSECT2 ID="R2-SQL-LOCK-1">
...@@ -44,13 +44,21 @@ Inputs ...@@ -44,13 +44,21 @@ Inputs
<REFSECT2 ID="R2-SQL-LOCK-2"> <REFSECT2 ID="R2-SQL-LOCK-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -69,27 +77,31 @@ ERROR <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>: Table does not exist. ...@@ -69,27 +77,31 @@ ERROR <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>: Table does not exist.
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned if table don't exist. Message returned if <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
does not exist.
</VARIABLELIST> </VARIABLELIST>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
</REFSYNOPSISDIV> </REFSYNOPSISDIV>
<REFSECT1 ID="R1-SQL-LOCK-1"> <REFSECT1 ID="R1-SQL-LOCK-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
The LOCK statement locks in exclusive mode a table inside <command>LOCK</command> locks in exclusive mode a table inside
a transaction. The classic use for this is a transaction. The classic use for this is
the case where you want to select some data, then the case where you want to select some data, then
update it inside a transaction. update it inside a transaction.
If you don't explicit lock a table using LOCK statement, it will be If you don't explicit lock a table using LOCK statement, it will be
implicit locked only at first UPDATE, INSERT or DELETE operation. implicit locked only at the first
<command>UPDATE</command>, <command>INSERT</command>,
or <command>DELETE</command> operation.
If you don't exclusive lock the table before the select, some If you don't exclusive lock the table before the select, some
other user may also read the selected data, and try and do other user may also read the selected data, and try and do
their own update, causing a deadlock while you both wait their own update, causing a deadlock while you both wait
...@@ -105,18 +117,26 @@ Description ...@@ -105,18 +117,26 @@ Description
the tables to become available. The only solution to this the tables to become available. The only solution to this
is for both users to lock tables in the same order, so is for both users to lock tables in the same order, so
user's lock acquisitions and requests to not form a deadlock. user's lock acquisitions and requests to not form a deadlock.
<note>
<para>
<productname>Postgres</productname> does detect deadlocks and will
rollback transactions to resolve the deadlock. Usually, at least one
of the deadlocked transactions will complete successfully.
</note>
<REFSECT2 ID="R2-SQL-LOCK-3"> <REFSECT2 ID="R2-SQL-LOCK-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
LOCK is a PostgreSQL language extension. <command>LOCK</command> is a <productname>Postgres</productname>
language extension.
<para> <para>
LOCK works only inside transactions. <command>LOCK</command> works only inside transactions.
<note> <note>
<title>Bug</title> <title>Bug</title>
...@@ -134,14 +154,14 @@ Usage ...@@ -134,14 +154,14 @@ Usage
<PARA> <PARA>
</PARA> </PARA>
<ProgramListing> <ProgramListing>
--Explicit locking to prevent deadlock: --Explicit locking to prevent deadlock:
-- --
BEGIN WORK; BEGIN WORK;
LOCK films; LOCK films;
SELECT * FROM films; SELECT * FROM films;
UPDATE films SET len = INTERVAL '100 minute' UPDATE films SET len = INTERVAL '100 minute'
WHERE len = INTERVAL '117 minute'; WHERE len = INTERVAL '117 minute';
COMMIT WORK; COMMIT WORK;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -151,17 +171,17 @@ Usage ...@@ -151,17 +171,17 @@ Usage
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<REFSECT2 ID="R2-SQL-LOCK-4"> <REFSECT2 ID="R2-SQL-LOCK-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>, There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>,
it uses SET TRANSACTION to specify which instead uses <command>SET TRANSACTION</command> to specify
concurrency level on transactions. concurrency level on transactions.
</REFENTRY> </REFENTRY>
...@@ -15,7 +15,7 @@ Moves cursor position ...@@ -15,7 +15,7 @@ Moves cursor position
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
MOVE [ <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> ] [ <REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE> ] MOVE [ <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> ] [ <REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE> ]
...@@ -25,35 +25,38 @@ FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL | ...@@ -25,35 +25,38 @@ FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL |
<REFSECT1 ID="R1-SQL-MOVE-1"> <REFSECT1 ID="R1-SQL-MOVE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
MOVE allows a user to move cursor position a specified <command>MOVE</command> allows a user to move cursor position a specified
number of rows. MOVE works like the FETCH command, but only number of rows.
positions the cursor and does <command>MOVE</command> works like the <command>FETCH</command> command,
but only positions the cursor and does
not return rows. not return rows.
<para> <para>
Refer to the FETCH command for details on syntax and usage. Refer to the <command>FETCH</command> command for details on syntax and usage.
<REFSECT2 ID="R2-SQL-MOVE-3"> <REFSECT2 ID="R2-SQL-MOVE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
MOVE is a <productname>Postgres</productname> language extension. <command>MOVE</command> is a <productname>Postgres</productname>
language extension.
<para> <para>
Refer to FETCH for a description Refer to <command>FETCH</command> for a description
of valid arguments. of valid arguments.
Refer to DECLARE to declare a cursor. Refer to <command>DECLARE</command> to declare a cursor.
Refer to BEGIN WORK, COMMIT WORK, ROLLBACK WORK statements Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
<command>ROLLBACK WORK</command> statements
for further information about transactions. for further information about transactions.
</REFSECT2> </REFSECT2>
...@@ -64,28 +67,31 @@ Usage ...@@ -64,28 +67,31 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
--set up and use a cursor: --set up and use a cursor:
-- --
BEGIN WORK; BEGIN WORK;
DECLARE liahona CURSOR DECLARE liahona CURSOR FOR SELECT * FROM films;
FOR SELECT * FROM films;
--Skip first 5 rows:
--
MOVE FORWARD 5 IN liahona;
--Fetch 6th row in the cursor liahona: --Skip first 5 rows:
-- --
FETCH 1 IN liahona; MOVE FORWARD 5 IN liahona;
<computeroutput>
code |title |did| date_prod|kind |len MOVE
-----+------+---+----------+----------+------ </computeroutput>
P_303|48 Hrs|103|1982-10-22|Action | 01:37 --Fetch 6th row in the cursor liahona:
--
-- close the cursor liahona and commit work: FETCH 1 IN liahona;
-- <computeroutput>
CLOSE liahona; FETCH
COMMIT WORK; code |title |did| date_prod|kind |len
-----+------+---+----------+----------+------
P_303|48 Hrs|103|1982-10-22|Action | 01:37
(1 row)
</computeroutput>
-- close the cursor liahona and commit work:
--
CLOSE liahona;
COMMIT WORK;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -105,6 +111,9 @@ Compatibility ...@@ -105,6 +111,9 @@ Compatibility
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no SQL92 MOVE statement. Instead, <acronym>SQL92</acronym> allows There is no SQL92 <command>MOVE</command> statement.
one to FETCH rows from an absolute cursor position. Instead, <acronym>SQL92</acronym> allows
one to <command>FETCH</command> rows from an absolute cursor position,
implicitly moving the cursor to the correct place.
</REFENTRY> </REFENTRY>
...@@ -15,7 +15,7 @@ Signals all frontends and backends listening on a class ...@@ -15,7 +15,7 @@ Signals all frontends and backends listening on a class
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
<REPLACEABLE CLASS="PARAMETER"> <REPLACEABLE CLASS="PARAMETER">
...@@ -25,13 +25,13 @@ NOTIFY <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE> ...@@ -25,13 +25,13 @@ NOTIFY <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE>
<REFSECT2 ID="R2-SQL-NOTIFY-1"> <REFSECT2 ID="R2-SQL-NOTIFY-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -47,13 +47,21 @@ Table or arbitrary relation class used for notification. ...@@ -47,13 +47,21 @@ Table or arbitrary relation class used for notification.
<REFSECT2 ID="R2-SQL-NOTIFY-2"> <REFSECT2 ID="R2-SQL-NOTIFY-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -63,6 +71,7 @@ NOTIFY ...@@ -63,6 +71,7 @@ NOTIFY
<PARA> <PARA>
Notification message from backend. Notification message from backend.
</VARIABLELIST>
</VARIABLELIST> </VARIABLELIST>
</REFSECT2> </REFSECT2>
...@@ -70,29 +79,30 @@ Notification message from backend. ...@@ -70,29 +79,30 @@ Notification message from backend.
<REFSECT1 ID="R1-SQL-NOTIFY-1"> <REFSECT1 ID="R1-SQL-NOTIFY-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
NOTIFY is used to awaken all backends and consequently all <command>NOTIFY</command> is used to awaken all sessions which have
frontends that have executed <command>LISTEN</command> on previously executed
<replaceable class="parameter">classname</replaceable>. <command>LISTEN <replaceable class="parameter">classname</replaceable></command>.
This can be used either within an instance-level rule This can be used either within an instance-level rule
as part of the action body or from a normal query. as part of the action body or from a normal query.
<para> <para>
When used from within a normal query, When used from within a normal query,
this can be thought of as interprocess communication (IPC). When this can be thought of as interprocess communication (IPC). When
used from within a rule, this can be thought of as an alerter mechanism. used from within a rule, this can be thought of as an alert mechanism.
<para> <para>
Notice that the mere fact that a notify has been Note that the mere fact that a <command>NOTIFY</command> has been
executed does not imply anything in particular about the state executed does not imply anything in particular about the state
of the class (e.g., that it has been updated), of the class (e.g., that it has been updated),
nor does the notification protocol transmit any useful information nor does the notification protocol transmit any useful information
other than the class name. other than the class name.
Therefore, all notify does is indicate that some backend wishes its peers to Therefore, all <command>NOTIFY</command> does is indicate that some backend
wishes its peers to
examine <replaceable class="parameter">classname</replaceable> examine <replaceable class="parameter">classname</replaceable>
in some application-specific way. in some application-specific way.
<para> <para>
...@@ -103,8 +113,8 @@ Therefore, all notify does is indicate that some backend wishes its peers to ...@@ -103,8 +113,8 @@ Therefore, all notify does is indicate that some backend wishes its peers to
<para> <para>
This event notification is performed through the libpq protocol This event notification is performed through the libpq protocol
and frontend application interface. The application program and frontend application interface. The application program
must call the routine <function>PQnotifies</function> in order to find out the must call the routine <function>PQnotifies</function>
name of the class to which a given in order to find out the name of the class to which a given
notification corresponds. notification corresponds.
If this code is not included in the application, If this code is not included in the application,
the event notification will be the event notification will be
...@@ -112,7 +122,7 @@ the event notification will be ...@@ -112,7 +122,7 @@ the event notification will be
<REFSECT2 ID="R2-SQL-NOTIFY-3"> <REFSECT2 ID="R2-SQL-NOTIFY-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -131,12 +141,15 @@ Usage ...@@ -131,12 +141,15 @@ Usage
<ProgramListing> <ProgramListing>
-- Configure and execute a listen/notify sequence -- Configure and execute a listen/notify sequence
-- from psql -- from psql
postgres=> create table t (i int4); CREATE TABLE t (i int4);
postgres=> listen t; <computeroutput>
LISTEN LISTEN t;
postgres=> notify t; </computeroutput>
NOTIFY t;
<computeroutput>
NOTIFY NOTIFY
ASYNC NOTIFY of 't' from backend pid '10949' received ASYNC NOTIFY of 't' from backend pid '10949' received
</computeroutput>
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -146,16 +159,16 @@ ASYNC NOTIFY of 't' from backend pid '10949' received ...@@ -146,16 +159,16 @@ ASYNC NOTIFY of 't' from backend pid '10949' received
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<REFSECT2 ID="R2-SQL-NOTIFY-4"> <REFSECT2 ID="R2-SQL-NOTIFY-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no NOTIFY statement in <acronym>SQL92</acronym>. There is no <command>NOTIFY</command> statement in <acronym>SQL92</acronym>.
</REFENTRY> </REFENTRY>
...@@ -15,7 +15,7 @@ Restores run-time parameters for session to default values ...@@ -15,7 +15,7 @@ Restores run-time parameters for session to default values
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
RESET <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> RESET <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
...@@ -23,13 +23,13 @@ RESET <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> ...@@ -23,13 +23,13 @@ RESET <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
<REFSECT2 ID="R2-SQL-RESET-1"> <REFSECT2 ID="R2-SQL-RESET-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -45,13 +45,20 @@ Inputs ...@@ -45,13 +45,20 @@ Inputs
<REFSECT2 ID="R2-SQL-RESET-2"> <REFSECT2 ID="R2-SQL-RESET-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
...@@ -60,8 +67,11 @@ RESET VARIABLE ...@@ -60,8 +67,11 @@ RESET VARIABLE
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned if successfully. Message returned if
<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> is successfully reset
to its default value..
</VARIABLELIST>
</VARIABLELIST> </VARIABLELIST>
</REFSECT2> </REFSECT2>
...@@ -69,22 +79,24 @@ RESET VARIABLE ...@@ -69,22 +79,24 @@ RESET VARIABLE
<REFSECT1 ID="R1-SQL-RESET-1"> <REFSECT1 ID="R1-SQL-RESET-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
The RESET statement restores variables to the default values. <command>RESET</command> restores variables to the
Refer to the SET command for details on allowed values and defaults. default values.
RESET is an alternate form for Refer to the <command>SET</command> command for details on
allowed values and defaults.
<command>RESET</command> is an alternate form for
<synopsis> <synopsis>
<command>SET <replaceable class="parameter">variable</replaceable> = DEFAULT</command> <command>SET <replaceable class="parameter">variable</replaceable> = DEFAULT</command>
</synopsis> </synopsis>
<REFSECT2 ID="R2-SQL-RESET-3"> <REFSECT2 ID="R2-SQL-RESET-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -103,12 +115,12 @@ Usage ...@@ -103,12 +115,12 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
-- reset DateStyle to its default; -- reset DateStyle to its default;
RESET DateStyle; RESET DateStyle;
</programlisting> </programlisting>
<programlisting> <programlisting>
-- reset Geqo to its default; -- reset Geqo to its default;
RESET GEQO; RESET GEQO;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -118,35 +130,15 @@ Usage ...@@ -118,35 +130,15 @@ Usage
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<REFSECT2 ID="R2-SQL-RESET-4"> <REFSECT2 ID="R2-SQL-RESET-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no RESET statement in SQL92. There is no <command>RESET</command> in <acronym>SQL92</acronym>.
</REFENTRY>
<!-- </REFENTRY>
<REPLACEABLE CLASS="PARAMETER">
</REPLACEABLE>
<ReturnValue></ReturnValue>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>&bull;
</TERM>
<LISTITEM>
<PARA>
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>
</PARA>
-->
...@@ -15,7 +15,7 @@ Revokes access privilege from a user, a group or all users. ...@@ -15,7 +15,7 @@ Revokes access privilege from a user, a group or all users.
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
<REPLACEABLE CLASS="PARAMETER"> <REPLACEABLE CLASS="PARAMETER">
...@@ -27,13 +27,13 @@ REVOKE <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...] ...@@ -27,13 +27,13 @@ REVOKE <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...]
<REFSECT2 ID="R2-SQL-REVOKE-1"> <REFSECT2 ID="R2-SQL-REVOKE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -89,7 +89,7 @@ RULE ...@@ -89,7 +89,7 @@ RULE
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Privilege to define rules on table/view. Privilege to define rules on table/view.
(See the <command>CREATE RULE</command> statement). (See <command>CREATE RULE</command>).
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -159,13 +159,20 @@ Rescind the specified privilege(s) for all users. ...@@ -159,13 +159,20 @@ Rescind the specified privilege(s) for all users.
<REFSECT2 ID="R2-SQL-REVOKE-2"> <REFSECT2 ID="R2-SQL-REVOKE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
...@@ -186,13 +193,14 @@ ERROR ...@@ -186,13 +193,14 @@ ERROR
to revoke privileges from a group or users. to revoke privileges from a group or users.
</VARIABLELIST> </VARIABLELIST>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
</REFSYNOPSISDIV> </REFSYNOPSISDIV>
<REFSECT1 ID="R1-SQL-REVOKE-1"> <REFSECT1 ID="R1-SQL-REVOKE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -203,7 +211,7 @@ Description ...@@ -203,7 +211,7 @@ Description
<REFSECT2 ID="R2-SQL-REVOKE-3"> <REFSECT2 ID="R2-SQL-REVOKE-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -249,13 +257,13 @@ Usage ...@@ -249,13 +257,13 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
-- revoke insert privilege from all users on table films: -- revoke insert privilege from all users on table films:
-- --
REVOKE INSERT ON films FROM PUBLIC; REVOKE INSERT ON films FROM PUBLIC;
-- revoke all privileges from user manuel on view kinds: -- revoke all privileges from user manuel on view kinds:
-- --
REVOKE ALL ON kinds FROM manuel; REVOKE ALL ON kinds FROM manuel;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -265,7 +273,6 @@ Usage ...@@ -265,7 +273,6 @@ Usage
Compatibility Compatibility
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<REFSECT2 ID="R2-SQL-REVOKE-4"> <REFSECT2 ID="R2-SQL-REVOKE-4">
<REFSECT2INFO> <REFSECT2INFO>
...@@ -275,7 +282,8 @@ Compatibility ...@@ -275,7 +282,8 @@ Compatibility
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
The SQL92 syntax for REVOKE has additional capabilities for rescinding The SQL92 syntax for <command>REVOKE</command>
has additional capabilities for rescinding
privileges, including those on individual columns in tables: privileges, including those on individual columns in tables:
<variablelist> <variablelist>
...@@ -328,23 +336,3 @@ If user1 gives a privilege WITH GRANT OPTION to user2, ...@@ -328,23 +336,3 @@ If user1 gives a privilege WITH GRANT OPTION to user2,
this privilege it fails if he/she specify the RESTRICT this privilege it fails if he/she specify the RESTRICT
keyword. keyword.
</REFENTRY> </REFENTRY>
<!--
<REPLACEABLE CLASS="PARAMETER">
</REPLACEABLE>
<ReturnValue></ReturnValue>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>&bull;
</TERM>
<LISTITEM>
<PARA>
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>
</PARA>
-->
...@@ -14,7 +14,7 @@ Aborts the current transaction ...@@ -14,7 +14,7 @@ Aborts the current transaction
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
ROLLBACK [ WORK ] ROLLBACK [ WORK ]
...@@ -22,7 +22,7 @@ ROLLBACK [ WORK ] ...@@ -22,7 +22,7 @@ ROLLBACK [ WORK ]
<REFSECT2 ID="R2-SQL-ROLLBACK-1"> <REFSECT2 ID="R2-SQL-ROLLBACK-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-09-01</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
...@@ -34,7 +34,7 @@ None. ...@@ -34,7 +34,7 @@ None.
<REFSECT2 ID="R2-SQL-ROLLBACK-2"> <REFSECT2 ID="R2-SQL-ROLLBACK-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -67,18 +67,18 @@ ABORT ...@@ -67,18 +67,18 @@ ABORT
<REFSECT1 ID="R1-SQL-ROLLBACK-1"> <REFSECT1 ID="R1-SQL-ROLLBACK-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
ROLLBACK rolls back the current transaction and causes <command>ROLLBACK</command> rolls back the current transaction and causes
all the updates made by the transaction to be discarded. all the updates made by the transaction to be discarded.
<REFSECT2 ID="R2-SQL-ROLLBACK-3"> <REFSECT2 ID="R2-SQL-ROLLBACK-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -87,7 +87,8 @@ Notes ...@@ -87,7 +87,8 @@ Notes
The keyword WORK is noise and can be omitted. The keyword WORK is noise and can be omitted.
<para> <para>
Use the COMMIT statement to successfully terminate a transaction. Use the <command>COMMIT</command> statement to successfully
terminate a transaction.
</REFSECT1> </REFSECT1>
...@@ -97,9 +98,9 @@ Usage ...@@ -97,9 +98,9 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
--To abort all changes: --To abort all changes:
-- --
ROLLBACK WORK; ROLLBACK WORK;
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -113,7 +114,7 @@ Compatibility ...@@ -113,7 +114,7 @@ Compatibility
<REFSECT2 ID="R2-SQL-ROLLBACK-4"> <REFSECT2 ID="R2-SQL-ROLLBACK-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
...@@ -121,23 +122,3 @@ SQL92 ...@@ -121,23 +122,3 @@ SQL92
<PARA> <PARA>
Full compatibility. Full compatibility.
</REFENTRY> </REFENTRY>
<!--
<REPLACEABLE CLASS="PARAMETER">
</REPLACEABLE>
<ReturnValue></ReturnValue>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>&bull;
</TERM>
<LISTITEM>
<PARA>
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>
</PARA>
-->
...@@ -14,23 +14,23 @@ ...@@ -14,23 +14,23 @@
</refpurpose></refnamediv> </refpurpose></refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<refsynopsisdivinfo> <refsynopsisdivinfo>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsynopsisdivinfo> </refsynopsisdivinfo>
<synopsis> <synopsis>
SELECT [ALL|DISTINCT] SELECT [ALL|DISTINCT]
<replaceable class="PARAMETER">expression</replaceable> [AS <replaceable class="PARAMETER">name</replaceable>] [, ...] <replaceable class="PARAMETER">expression</replaceable> [ AS <replaceable class="PARAMETER">name</replaceable> ] [, ...]
[INTO [TABLE] <replaceable class="PARAMETER">intable</replaceable>] [ INTO [TABLE] <replaceable class="PARAMETER">new_table</replaceable> ]
[FROM <replaceable class="PARAMETER">table</replaceable> [<replaceable class="PARAMETER">alias</replaceable>] [, ...] ] [ FROM <replaceable class="PARAMETER">table</replaceable> [<replaceable class="PARAMETER">alias</replaceable> ] [, ...] ]
[WHERE <replaceable class="PARAMETER">condition</replaceable>] [ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
[GROUP BY <replaceable class="PARAMETER">column</replaceable> [, ...] ] [ GROUP BY <replaceable class="PARAMETER">column</replaceable> [, ...] ]
[HAVING <replaceable class="PARAMETER">condition</replaceable> [, ...] ] [ HAVING <replaceable class="PARAMETER">condition</replaceable> [, ...] ]
[UNION [ALL] <replaceable class="PARAMETER">select</replaceable>] [ UNION [ALL] <replaceable class="PARAMETER">select</replaceable> ]
[ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...] ] [ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ ASC | DESC ] [, ...] ]
</synopsis> </synopsis>
<refsect2 id="R2-SQL-SELECT-1"> <refsect2 id="R2-SQL-SELECT-1">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
Inputs Inputs
...@@ -66,16 +66,16 @@ SELECT [ALL|DISTINCT] ...@@ -66,16 +66,16 @@ SELECT [ALL|DISTINCT]
<varlistentry> <varlistentry>
<term> <term>
<replaceable class="PARAMETER">intable</replaceable> <replaceable class="PARAMETER">new_table</replaceable>
</term> </term>
<listitem> <listitem>
<para> <para>
If the INTO TABLE clause is specified, the result of the If the INTO TABLE clause is specified, the result of the
query will be stored in another table with the indicated query will be stored in another table with the indicated
name. name.
If <replaceable class="PARAMETER">intable</replaceable> does If <replaceable class="PARAMETER">new_table</replaceable> does
not exist, it will be created automatically. not exist, it will be created automatically.
Refer to <command>SELECT INTO</command> for more information.
<note> <note>
<para> <para>
The <command>CREATE TABLE AS</command> statement will also The <command>CREATE TABLE AS</command> statement will also
...@@ -151,11 +151,13 @@ SELECT [ALL|DISTINCT] ...@@ -151,11 +151,13 @@ SELECT [ALL|DISTINCT]
<refsect2 id="R2-SQL-SELECT-2"> <refsect2 id="R2-SQL-SELECT-2">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
Outputs Outputs
</title> </title>
<para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
...@@ -170,7 +172,15 @@ SELECT [ALL|DISTINCT] ...@@ -170,7 +172,15 @@ SELECT [ALL|DISTINCT]
<varlistentry> <varlistentry>
<term> <term>
<returnvalue>count</returnvalue> <replaceable>status</replaceable>
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
<returnvalue><replaceable>count</replaceable></returnvalue>
</term> </term>
<listitem> <listitem>
<para> <para>
...@@ -179,19 +189,21 @@ SELECT [ALL|DISTINCT] ...@@ -179,19 +189,21 @@ SELECT [ALL|DISTINCT]
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</variablelist>
</refsect2> </refsect2>
</refsynopsisdiv> </refsynopsisdiv>
<refsect1 id="R1-SQL-SELECT-1"> <refsect1 id="R1-SQL-SELECT-1">
<refsect1info> <refsect1info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect1info> </refsect1info>
<title> <title>
Description Description
</title> </title>
<para> <para>
SELECT will get all rows which satisfy the WHERE condition <command>SELECT</command> will get all rows which satisfy the
WHERE condition
or all rows of a table if WHERE is omitted.</para> or all rows of a table if WHERE is omitted.</para>
<para> <para>
...@@ -214,20 +226,21 @@ SELECT [ALL|DISTINCT] ...@@ -214,20 +226,21 @@ SELECT [ALL|DISTINCT]
<para> <para>
You must have SELECT privilege to a table to read its values You must have SELECT privilege to a table to read its values
(See GRANT/REVOKE statements).</para> (See <command>GRANT</command>/<command>REVOKE</command> statements).
</para>
<refsect2 id="R2-SQL-WHERE-2"> <refsect2 id="R2-SQL-WHERE-2">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
WHERE clause WHERE Clause
</title> </title>
<para> <para>
The optional WHERE condition has the general form: The optional WHERE condition has the general form:
<synopsis> <synopsis>
WHERE <replaceable class="PARAMETER">expr</replaceable> <replaceable class="PARAMETER">cond_op</replaceable> <replaceable class="PARAMETER">expr</replaceable> [<replaceable class="PARAMETER">log_op</replaceable> ...] WHERE <replaceable class="PARAMETER">expr</replaceable> <replaceable class="PARAMETER">cond_op</replaceable> <replaceable class="PARAMETER">expr</replaceable> [ <replaceable class="PARAMETER">log_op</replaceable> ... ]
</synopsis> </synopsis>
where <replaceable class="PARAMETER">cond_op</replaceable> can be where <replaceable class="PARAMETER">cond_op</replaceable> can be
...@@ -243,24 +256,24 @@ WHERE <replaceable class="PARAMETER">expr</replaceable> <replaceable class="PARA ...@@ -243,24 +256,24 @@ WHERE <replaceable class="PARAMETER">expr</replaceable> <replaceable class="PARA
<refsect2 id="R2-SQL-GROUPBY-2"> <refsect2 id="R2-SQL-GROUPBY-2">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
GROUP BY clause GROUP BY Clause
</title> </title>
<para> <para>
GROUP BY specifies a grouped table derived by the application GROUP BY specifies a grouped table derived by the application
of the this clause: of the this clause:
<synopsis> <synopsis>
GROUP BY <replaceable class="PARAMETER">column</replaceable> [, ...] GROUP BY <replaceable class="PARAMETER">column</replaceable> [, ...]
</synopsis></para></refsect2> </synopsis></para></refsect2>
<refsect2 id="R2-SQL-HAVING-2"> <refsect2 id="R2-SQL-HAVING-2">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
HAVING clause HAVING Clause
</title> </title>
<para> <para>
The optional HAVING condition has the general form: The optional HAVING condition has the general form:
...@@ -278,21 +291,22 @@ HAVING <replaceable class="PARAMETER">cond_expr</replaceable> ...@@ -278,21 +291,22 @@ HAVING <replaceable class="PARAMETER">cond_expr</replaceable>
that do not meet the <replaceable class="PARAMETER">cond_expr</replaceable>.</para> that do not meet the <replaceable class="PARAMETER">cond_expr</replaceable>.</para>
<para> <para>
Each column referenced in <replaceable class="PARAMETER">cond_expr</replaceable> shall unambiguously Each column referenced in
<replaceable class="PARAMETER">cond_expr</replaceable> shall unambiguously
reference a grouping column. reference a grouping column.
</para> </para>
</refsect2> </refsect2>
<refsect2 id="R2-SQL-ORDERBYCLAUSE-2"> <refsect2 id="R2-SQL-ORDERBYCLAUSE-2">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
ORDER BY clause ORDER BY Clause
</title> </title>
<para> <para>
<synopsis> <synopsis>
ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...] ORDER BY <replaceable class="PARAMETER">column</replaceable> [ ASC | DESC ] [, ...]
</synopsis></para> </synopsis></para>
<para> <para>
...@@ -302,17 +316,18 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -302,17 +316,18 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
The ordinal numbers refers to the ordinal (left-to-right) position The ordinal numbers refers to the ordinal (left-to-right) position
of the column. This feature makes it possible to define an ordering of the column. This feature makes it possible to define an ordering
on the basis of a column that does not have a proper name. on the basis of a column that does not have a proper name.
This is never absolutely necessary because it is always possible assign a name This is never absolutely necessary because it is always possible
assign a name
to a calculated column using the AS clause, e.g.: to a calculated column using the AS clause, e.g.:
<programlisting> <programlisting>
SELECT title, date_prod + 1 AS newlen FROM films ORDER BY newlen; SELECT title, date_prod + 1 AS newlen FROM films ORDER BY newlen;
</programlisting></para> </programlisting></para>
<para> <para>
The columns in the ORDER BY must appear in the SELECT clause. The columns in the ORDER BY must appear in the SELECT clause.
Thus the following statement is illegal: Thus the following statement is illegal:
<programlisting> <programlisting>
SELECT name FROM distributors ORDER BY code; SELECT name FROM distributors ORDER BY code;
</programlisting></para> </programlisting></para>
<para> <para>
...@@ -323,15 +338,15 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -323,15 +338,15 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
<refsect2 id="R2-SQL-UNION-2"> <refsect2 id="R2-SQL-UNION-2">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
UNION clause UNION Clause
</title> </title>
<para> <para>
<synopsis> <synopsis>
<replaceable class="PARAMETER">table_query</replaceable> UNION [ALL] <replaceable class="PARAMETER">table_query</replaceable> <replaceable class="PARAMETER">table_query</replaceable> UNION [ ALL ] <replaceable class="PARAMETER">table_query</replaceable>
[ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...] ] [ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ ASC | DESC ] [, ...] ]
</synopsis> </synopsis>
where where
...@@ -349,9 +364,10 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -349,9 +364,10 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
unless the ALL clause is specified.</para> unless the ALL clause is specified.</para>
<para> <para>
Multiple UNION operators in the same SELECT statement are evaluated left to right. Multiple UNION operators in the same SELECT statement are
Note that the ALL keyword is not global in nature, being applied only for the current pair of evaluated left to right.
table results.</para> Note that the ALL keyword is not global in nature, being
applied only for the current pair of table results.</para>
</refsect2></refsect1> </refsect2></refsect1>
...@@ -364,9 +380,9 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -364,9 +380,9 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
<literal>distributors</literal>: <literal>distributors</literal>:
</para> </para>
<programlisting> <programlisting>
SELECT f.title, f.did, d.name, f.date_prod, f.kind SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM distributors d, films f FROM distributors d, films f
WHERE f.did = d.did WHERE f.did = d.did
title |did|name | date_prod|kind title |did|name | date_prod|kind
-------------------------+---+----------------+----------+---------- -------------------------+---+----------------+----------+----------
...@@ -393,7 +409,7 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -393,7 +409,7 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
the reults by <literal>kind</literal>: the reults by <literal>kind</literal>:
</para> </para>
<programlisting> <programlisting>
SELECT kind, SUM(len) AS total FROM films GROUP BY kind; SELECT kind, SUM(len) AS total FROM films GROUP BY kind;
kind |total kind |total
----------+------ ----------+------
...@@ -410,10 +426,10 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -410,10 +426,10 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
that are less than 5 hours: that are less than 5 hours:
</para> </para>
<programlisting> <programlisting>
SELECT kind, SUM(len) AS total SELECT kind, SUM(len) AS total
FROM films FROM films
GROUP BY kind GROUP BY kind
HAVING SUM(len) < INTERVAL '5 hour'; HAVING SUM(len) < INTERVAL '5 hour';
kind |total kind |total
----------+------ ----------+------
...@@ -426,8 +442,8 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -426,8 +442,8 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
(<literal>name</literal>): (<literal>name</literal>):
</para> </para>
<programlisting> <programlisting>
SELECT * FROM distributors ORDER BY name; SELECT * FROM distributors ORDER BY name;
SELECT * FROM distributors ORDER BY 2; SELECT * FROM distributors ORDER BY 2;
did|name did|name
---+---------------- ---+----------------
...@@ -462,13 +478,13 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -462,13 +478,13 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
-- 112|Warner Bros. 3|Walter Matthau -- 112|Warner Bros. 3|Walter Matthau
-- ... ... -- ... ...
SELECT distributors.name SELECT distributors.name
FROM distributors FROM distributors
WHERE distributors.name LIKE 'W%' WHERE distributors.name LIKE 'W%'
UNION UNION
SELECT actors.name SELECT actors.name
FROM actors FROM actors
WHERE actors.name LIKE 'W%' WHERE actors.name LIKE 'W%'
name name
-------------- --------------
...@@ -491,7 +507,7 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -491,7 +507,7 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
<refsect2 id="R2-SQL-SELECT-4"> <refsect2 id="R2-SQL-SELECT-4">
<refsect2info> <refsect2info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect2info> </refsect2info>
<title> <title>
<acronym>SQL92</acronym> <acronym>SQL92</acronym>
...@@ -504,7 +520,7 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -504,7 +520,7 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
<date>1998-04-15</date> <date>1998-04-15</date>
</refsect3info> </refsect3info>
<title> <title>
SELECT clause SELECT Clause
</title> </title>
<para> <para>
In the <acronym>SQL92</acronym> standard, the optional keyword "AS" In the <acronym>SQL92</acronym> standard, the optional keyword "AS"
...@@ -526,10 +542,10 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -526,10 +542,10 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
<refsect3 id="R3-SQL-UNION-1"> <refsect3 id="R3-SQL-UNION-1">
<refsect3info> <refsect3info>
<date>1998-09-06</date> <date>1998-09-24</date>
</refsect3info> </refsect3info>
<title> <title>
UNION clause UNION Clause
</title> </title>
<para> <para>
The <acronym>SQL92</acronym> syntax for UNION allows an The <acronym>SQL92</acronym> syntax for UNION allows an
...@@ -550,6 +566,73 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ... ...@@ -550,6 +566,73 @@ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ASC | DESC] [, ...
</refsect1> </refsect1>
</refentry> </refentry>
<refentry id="SQL-SELECTINTO">
<refmeta>
<refentrytitle>
SELECT
</refentrytitle>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>
SELECT INTO
</refname>
<refpurpose>
Create a new table from an existing table or view
</refpurpose></refnamediv>
<refsynopsisdiv>
<refsynopsisdivinfo>
<date>1998-09-22</date>
</refsynopsisdivinfo>
<synopsis>
SELECT [ ALL | DISTINCT ] <replaceable class="PARAMETER">expression</replaceable> [ AS <replaceable class="PARAMETER">name</replaceable> ] [, ...]
INTO [ TABLE ] <replaceable class="PARAMETER">new_table</replaceable> ]
[ FROM <replaceable class="PARAMETER">table</replaceable> [<replaceable class="PARAMETER">alias</replaceable>] [, ...] ]
[ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
[ GROUP BY <replaceable class="PARAMETER">column</replaceable> [, ...] ]
[ HAVING <replaceable class="PARAMETER">condition</replaceable> [, ...] ]
[ UNION [ ALL ] <replaceable class="PARAMETER">select</replaceable>]
[ ORDER BY <replaceable class="PARAMETER">column</replaceable> [ ASC | DESC ] [, ...] ]
</synopsis>
<refsect2 id="R2-SQL-SELECTINTO-1">
<refsect2info>
<date>1998-09-22</date>
</refsect2info>
<title>
Inputs
</title>
<para>
All input fields are described in detail for SELECT.
<refsect2 id="R2-SQL-SELECTINTO-2">
<refsect2info>
<date>1998-09-22</date>
</refsect2info>
<title>
Outputs
</title>
<para>
All output fields are described in detail for SELECT.
<refsect1 id="R1-SQL-SELECTINTO-1">
<refsect1info>
<date>1998-09-22</date>
</refsect1info>
<title>
Description
</title>
<para>
SELECT INTO creates a new table from the results of a query. Typically, this
query draws data from an existing table, but any SQL query is allowed.
<note>
<para>
CREATE TABLE AS is functionally equivalent to the SELECT INTO command.
</note>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
......
...@@ -14,7 +14,7 @@ SET ...@@ -14,7 +14,7 @@ SET
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
<REPLACEABLE CLASS="PARAMETER"> <REPLACEABLE CLASS="PARAMETER">
...@@ -26,12 +26,13 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL ...@@ -26,12 +26,13 @@ SET TIME ZONE { '<REPLACEABLE CLASS="PARAMETER">timezone</REPLACEABLE>' | LOCAL
<REFSECT2 ID="R2-SQL-SET-1"> <REFSECT2 ID="R2-SQL-SET-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -210,7 +211,8 @@ set time zone to your local timezone ...@@ -210,7 +211,8 @@ set time zone to your local timezone
</varlistentry> </varlistentry>
</variablelist> </variablelist>
There are also several internal or optimization parameters which can be specified There are also several internal or optimization
parameters which can be specified
by the <command>SET</command> command: by the <command>SET</command> command:
<variablelist> <variablelist>
...@@ -293,12 +295,13 @@ enables the genetic optimizer algorithm ...@@ -293,12 +295,13 @@ enables the genetic optimizer algorithm
for statements with 8 or more tables. for statements with 8 or more tables.
<varlistentry> <varlistentry>
<term> <term>
On=# On=<replaceable class="parameter">#</replaceable>
</term> </term>
<listitem> <listitem>
<para> <para>
enables the genetic optimizer algorithm Takes an integer argument to enable the genetic optimizer algorithm
for statements with # or more tables. for statements with <replaceable class="parameter">#</replaceable>
or more tables in the query.
<varlistentry> <varlistentry>
<term> <term>
Off Off
...@@ -418,17 +421,25 @@ Equivalent to specifying <command>SET R_PLANS=Off</command>. ...@@ -418,17 +421,25 @@ Equivalent to specifying <command>SET R_PLANS=Off</command>.
<REFSECT2 ID="R2-SQL-SET-2"> <REFSECT2 ID="R2-SQL-SET-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<replaceable>status</replaceable>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
SET VARIABLE <returnvalue>SET VARIABLE</returnvalue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
...@@ -436,44 +447,46 @@ Outputs ...@@ -436,44 +447,46 @@ Outputs
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
WARN: Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>) <returnvalue>WARN: Bad value for <replaceable class="parameter">variable</replaceable> (<replaceable class="parameter">value</replaceable>)</returnvalue>
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
If fails to set variable. If the command fails to set variable.
</VARLISTENTRY> </VARLISTENTRY>
</VARIABLELIST> </VARIABLELIST>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
</REFSYNOPSISDIV> </REFSYNOPSISDIV>
<REFSECT1 ID="R1-SQL-SET-1"> <REFSECT1 ID="R1-SQL-SET-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
SET will modify configuration parameters for variable during <command>SET</command> will modify configuration parameters for variable during
a session. a session.
<para> <para>
Current values can be obtained using SHOW statement, and values Current values can be obtained using <command>SHOW</command>, and values
can be restored to the defaults using RESET statement. can be restored to the defaults using <command>RESET</command>.
Parameters and values are case-insensitive. Note that the value Parameters and values are case-insensitive. Note that the value
field is always specified as a string, so is enclosed in field is always specified as a string, so is enclosed in
single-quotes. single-quotes.
<para> <para>
SET TIME ZONE changes the session's default time zone offset. <command>SET TIME ZONE</command> changes the session's
default time zone offset.
A SQL-session always begins with an initial default time zone A SQL-session always begins with an initial default time zone
offset. offset.
The SET TIME ZONE statement is used to change the default The <command>SET TIME ZONE</command> statement is used to change the default
time zone offset for the current SQL session. time zone offset for the current SQL session.
<REFSECT2 ID="R2-SQL-SET-3"> <REFSECT2 ID="R2-SQL-SET-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
...@@ -483,7 +496,8 @@ The <command>SET <replaceable class="parameter">variable</replaceable></command> ...@@ -483,7 +496,8 @@ The <command>SET <replaceable class="parameter">variable</replaceable></command>
statement is a <productname>Postgres</productname> language extension. statement is a <productname>Postgres</productname> language extension.
<para> <para>
Refer to SHOW/RESET statements to show/reset variable values. Refer to <command>SHOW</command> and <command>RESET</command> to
display or reset the current values.
</REFSECT2> </REFSECT2>
</REFSECT1> </REFSECT1>
...@@ -495,35 +509,35 @@ Usage ...@@ -495,35 +509,35 @@ Usage
<PARA> <PARA>
</PARA> </PARA>
<ProgramListing> <ProgramListing>
--Set the style of date to ISO: --Set the style of date to ISO:
-- --
SET DATESTYLE TO 'ISO'; SET DATESTYLE TO 'ISO';
</programlisting> </programlisting>
<programlisting> <programlisting>
--Set GEQO to default: --Set GEQO to default:
-- --
SET GEQO = DEFAULT; SET GEQO = DEFAULT;
</programlisting> </programlisting>
<programlisting> <programlisting>
--Turn on right-hand evaluation of plans: --Turn on right-hand evaluation of plans:
-- --
SET R_PLANS TO 'on'; SET R_PLANS TO 'on';
</programlisting> </programlisting>
<programlisting> <programlisting>
--set the timezone for Berkeley, California: --set the timezone for Berkeley, California:
SET TIME ZONE 'PST8PDT'; SET TIME ZONE 'PST8PDT';
SELECT CURRENT_TIMESTAMP AS today; SELECT CURRENT_TIMESTAMP AS today;
today today
---------------------- ----------------------
1998-03-31 07:41:21-08 1998-03-31 07:41:21-08
</programlisting> </programlisting>
<programlisting> <programlisting>
--set the timezone for Italy: --set the timezone for Italy:
SET TIME ZONE 'Europe/Rome'; SET TIME ZONE 'Europe/Rome';
SELECT CURRENT_TIMESTAMP AS today; SELECT CURRENT_TIMESTAMP AS today;
today today
---------------------- ----------------------
...@@ -541,7 +555,7 @@ Compatibility ...@@ -541,7 +555,7 @@ Compatibility
<REFSECT2 ID="R2-SQL-SET-4"> <REFSECT2 ID="R2-SQL-SET-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
...@@ -549,9 +563,10 @@ SQL92 ...@@ -549,9 +563,10 @@ SQL92
<PARA> <PARA>
There is no There is no
<command>SET <replaceable class="parameter">variable</replaceable></command> <command>SET <replaceable class="parameter">variable</replaceable></command>
in SQL92. in <acronym>SQL92</acronym>.
The SQL92 syntax for SET TIME ZONE is slightly different, The <acronym>SQL92</acronym> syntax for <command>SET TIME ZONE</command>
is slightly different,
allowing only a single integer value for time zone specification: allowing only a single integer value for time zone specification:
<programlisting> <programlisting>
...@@ -559,23 +574,3 @@ SET TIME ZONE { interval_value_expression | LOCAL } ...@@ -559,23 +574,3 @@ SET TIME ZONE { interval_value_expression | LOCAL }
</programlisting> </programlisting>
</REFENTRY> </REFENTRY>
<!--
<REPLACEABLE CLASS="PARAMETER">
</REPLACEABLE>
<ReturnValue></ReturnValue>
<PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>&bull;
</TERM>
<LISTITEM>
<PARA>
</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<PARA>
</PARA>
-->
...@@ -14,7 +14,7 @@ Shows run-time parameters for session ...@@ -14,7 +14,7 @@ Shows run-time parameters for session
</REFPURPOSE> </REFPURPOSE>
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
SHOW <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> SHOW <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
...@@ -22,13 +22,13 @@ SHOW <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> ...@@ -22,13 +22,13 @@ SHOW <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
<REFSECT2 ID="R2-SQL-SHOW-1"> <REFSECT2 ID="R2-SQL-SHOW-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -36,7 +36,7 @@ Inputs ...@@ -36,7 +36,7 @@ Inputs
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Refer to the SET statement for more information on available Refer to <command>SET</command> for more information on available
variables. variables.
</VARLISTENTRY> </VARLISTENTRY>
</VARIABLELIST> </VARIABLELIST>
...@@ -45,70 +45,92 @@ Inputs ...@@ -45,70 +45,92 @@ Inputs
<REFSECT2 ID="R2-SQL-SHOW-2"> <REFSECT2 ID="R2-SQL-SHOW-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST>
<VARLISTENTRY>
<TERM>
<REPLACEABLE>status</REPLACEABLE>
</TERM>
<LISTITEM>
<PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
NOTICE: <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> is <ReturnValue>value</ReturnValue> <returnvalue>NOTICE: <REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> is <replaceable>value</replaceable></ReturnValue>
SHOW VARIABLE SHOW VARIABLE
</TERM> </TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned if successfully. Message returned if successfully.
</listitem> </listitem>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
NOTICE: Unrecognized variable <ReturnValue>value</ReturnValue> <returnvalue>NOTICE: Unrecognized variable <replaceable>value</replaceable></ReturnValue>
</TERM>
<LISTITEM> <LISTITEM>
<PARA> <PARA>
Message returned if <ReturnValue>value</ReturnValue> does not exist. Message returned if <ReturnValue>value</ReturnValue> does not exist.
</PARA> </PARA>
</LISTITEM> </LISTITEM>
</VARLISTENTRY> </VARLISTENTRY>
<VARLISTENTRY>
<TERM>
NOTICE: Time zone is unknown
SHOW VARIABLE
</TERM>
<LISTITEM>
<PARA>
If the TZ environment variable is not set.
</VARIABLELIST> </VARIABLELIST>
</VARIABLELIST>
</REFSECT2> </REFSECT2>
</REFSYNOPSISDIV> </REFSYNOPSISDIV>
<REFSECT1 ID="R1-SQL-SHOW-1"> <REFSECT1 ID="R1-SQL-SHOW-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
</TITLE> </TITLE>
<PARA> <PARA>
SHOW will display the current configuration parameters for <command>SHOW</command> will display the current
configuration parameters for
variable during a session. variable during a session.
<para> <para>
The session can be configured using SET statement, and values The session can be configured using <command>SET</command> statement,
can be restored to the defaults using RESET statement. and values
can be restored to the defaults using <command>RESET</command> statement.
Parameters and values are case-insensitive. Parameters and values are case-insensitive.
<REFSECT2 ID="R2-SQL-SHOW-3"> <REFSECT2 ID="R2-SQL-SHOW-3">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Notes Notes
</TITLE> </TITLE>
<PARA> <PARA>
The SHOW statement is a <productname>Postgres</productname> The <command>SHOW</command> is a <productname>Postgres</productname>
language extension. language extension.
<para> <para>
Refer to the SET/RESET statements to set/reset variable values. Refer to <command>SET</command>/<command>RESET</command>
See also the SET TIME ZONE statement. to set/reset variable values.
See also <command>SET TIME ZONE</command>.
<para>
If the TZ environment variable is not set the SHOW TIME ZONE statement
gives the message: Time zone is unknown
</REFSECT2> </REFSECT2>
</REFSECT1> </REFSECT1>
...@@ -118,13 +140,13 @@ Usage ...@@ -118,13 +140,13 @@ Usage
</TITLE> </TITLE>
<PARA> <PARA>
<ProgramListing> <ProgramListing>
-- show DateStyle; -- show DateStyle;
SHOW DateStyle; SHOW DateStyle;
NOTICE:DateStyle is Postgres with US (NonEuropean) conventions NOTICE:DateStyle is Postgres with US (NonEuropean) conventions
-- show Geqo; -- show Geqo;
SHOW GEQO; SHOW GEQO;
NOTICE:GEQO is ON NOTICE:GEQO is ON
</ProgramListing> </ProgramListing>
</REFSECT1> </REFSECT1>
...@@ -138,13 +160,13 @@ Compatibility ...@@ -138,13 +160,13 @@ Compatibility
<REFSECT2 ID="R2-SQL-SHOW-4"> <REFSECT2 ID="R2-SQL-SHOW-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-08-31</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
</TITLE> </TITLE>
<PARA> <PARA>
There is no SET statement defined in <acronym>SQL92</acronym>. There is no <command>SET</command> defined in <acronym>SQL92</acronym>.
</refsect2> </refsect2>
</refsect1> </refsect1>
</REFENTRY> </REFENTRY>
...@@ -15,23 +15,23 @@ Replaces values of columns in a table ...@@ -15,23 +15,23 @@ Replaces values of columns in a table
<REFSYNOPSISDIV> <REFSYNOPSISDIV>
<REFSYNOPSISDIVINFO> <REFSYNOPSISDIVINFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSYNOPSISDIVINFO> </REFSYNOPSISDIVINFO>
<SYNOPSIS> <SYNOPSIS>
UPDATE <REPLACEABLE CLASS="PARAMETER">table</replaceable> SET <REPLACEABLE CLASS="PARAMETER">column</replaceable> = <REPLACEABLE CLASS="PARAMETER">expression</replaceable> [, ...] UPDATE <REPLACEABLE CLASS="PARAMETER">table</replaceable> SET <REPLACEABLE CLASS="PARAMETER">column</replaceable> = <REPLACEABLE CLASS="PARAMETER">expression</replaceable> [, ...]
[FROM <REPLACEABLE CLASS="PARAMETER">fromlist</REPLACEABLE>] [ FROM <REPLACEABLE CLASS="PARAMETER">fromlist</REPLACEABLE> ]
[WHERE <REPLACEABLE CLASS="PARAMETER">condition</REPLACEABLE>] [ WHERE <REPLACEABLE CLASS="PARAMETER">condition</REPLACEABLE> ]
</SYNOPSIS> </SYNOPSIS>
<REFSECT2 ID="R2-SQL-UPDATE-1"> <REFSECT2 ID="R2-SQL-UPDATE-1">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Inputs Inputs
</TITLE> </TITLE>
<PARA> <PARA>
</PARA>
<VARIABLELIST> <VARIABLELIST>
<VARLISTENTRY> <VARLISTENTRY>
<TERM> <TERM>
...@@ -86,7 +86,7 @@ The name of a column in <REPLACEABLE CLASS="PARAMETER">table</replaceable>. ...@@ -86,7 +86,7 @@ The name of a column in <REPLACEABLE CLASS="PARAMETER">table</replaceable>.
<REFSECT2 ID="R2-SQL-UPDATE-2"> <REFSECT2 ID="R2-SQL-UPDATE-2">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
Outputs Outputs
...@@ -114,7 +114,7 @@ If <replaceable class="parameter">#</replaceable> ...@@ -114,7 +114,7 @@ If <replaceable class="parameter">#</replaceable>
<REFSECT1 ID="R1-SQL-UPDATE-1"> <REFSECT1 ID="R1-SQL-UPDATE-1">
<REFSECT1INFO> <REFSECT1INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT1INFO> </REFSECT1INFO>
<TITLE> <TITLE>
Description Description
...@@ -172,7 +172,7 @@ Compatibility ...@@ -172,7 +172,7 @@ Compatibility
<REFSECT2 ID="R2-SQL-UPDATE-4"> <REFSECT2 ID="R2-SQL-UPDATE-4">
<REFSECT2INFO> <REFSECT2INFO>
<DATE>1998-04-15</DATE> <DATE>1998-09-24</DATE>
</REFSECT2INFO> </REFSECT2INFO>
<TITLE> <TITLE>
SQL92 SQL92
......
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