Include mention of CASE, COALESCE, and IFNULL.

Add date/time parsing procedure (perhaps should be in appendix).
Add time zone information (ditto).
Update keyword list.
This commit is contained in:
Thomas G. Lockhart 1999-05-12 07:32:47 +00:00
parent 5dd715b592
commit 95e3cec621
6 changed files with 1754 additions and 1658 deletions

@ -1,13 +1,16 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/admin.sgml,v 1.11 1999/05/04 02:16:57 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/admin.sgml,v 1.12 1999/05/12 07:32:42 thomas Exp $
Postgres Administrator's Guide. Postgres Administrator's Guide.
Derived from postgres.sgml. Derived from postgres.sgml.
- thomas 1998-10-27 - thomas 1998-10-27
$Log: admin.sgml,v $ $Log: admin.sgml,v $
Revision 1.11 1999/05/04 02:16:57 thomas Revision 1.12 1999/05/12 07:32:42 thomas
Include chapter on security. Include mention of CASE, COALESCE, and IFNULL.
Add date/time parsing procedure (perhaps should be in appendix).
Add time zone information (ditto).
Update keyword list.
Revision 1.10 1999/01/19 16:06:25 thomas Revision 1.10 1999/01/19 16:06:25 thomas
Merge current.sgml into release.sgml so all release notes are in the same Merge current.sgml into release.sgml so all release notes are in the same
@ -84,12 +87,12 @@ Bigger updates to the installation instructions (install and config).
<AuthorInitials>TGL</AuthorInitials> <AuthorInitials>TGL</AuthorInitials>
--> -->
<Date>(last updated 1998-10-27)</Date> <Date>(last updated 1999-04-08)</Date>
</BookBiblio> </BookBiblio>
<LegalNotice> <LegalNotice>
<Para> <Para>
<ProductName>PostgreSQL</ProductName> is copyright (C) 1998 <ProductName>PostgreSQL</ProductName> is copyright (C) 1998-9
by the Postgres Global Development Group. by the Postgres Global Development Group.
</Para> </Para>
</LegalNotice> </LegalNotice>

@ -2,7 +2,8 @@
<title>Bibliography</title> <title>Bibliography</title>
<para> <para>
Selected references and readings for <acronym>SQL</acronym> and <productname>Postgres</productname>. Selected references and readings for <acronym>SQL</acronym>
and <productname>Postgres</productname>.
</para> </para>
<bibliodiv> <bibliodiv>

@ -1,5 +1,5 @@
<Chapter Id="functions"> <Chapter Id="functions">
<Title>Functions</Title> <Title id="functions-title">Functions</Title>
<Abstract> <Abstract>
<Para> <Para>
@ -13,6 +13,54 @@ In addition, there are some type-specific functions. Some functions are also
available through operators and may be documented as operators only. available through operators and may be documented as operators only.
</Para> </Para>
<sect1>
<title id="sql-funcs">SQL Functions</title>
<para>
<quote><acronym>SQL</acronym> functions</quote> are constructs
defined by the <acronym>SQL92</acronym> standard which have
function-like syntax but which can not be implemented as simple
functions.
</para>
<para>
<TABLE TOCENTRY="1">
<TITLE>SQL Functions</TITLE>
<TGROUP COLS="4">
<THEAD>
<ROW>
<ENTRY>Function</ENTRY>
<ENTRY>Returns</ENTRY>
<ENTRY>Description</ENTRY>
<ENTRY>Example</ENTRY>
</ROW>
</THEAD>
<TBODY>
<ROW>
<ENTRY> COALESCE(<replaceable class="parameter">list</replaceable>) </ENTRY>
<ENTRY> non-NULL </ENTRY>
<ENTRY> return first non-NULL value in list </ENTRY>
<ENTRY> COALESCE(<replaceable class="parameter">c1</replaceable>, <replaceable class="parameter">c2</replaceable> + 5, 0) </ENTRY>
</ROW>
<ROW>
<ENTRY> IFNULL(<replaceable
class="parameter">input</replaceable>,<replaceable> class="parameter">non-NULL substitute</replaceable>) </ENTRY>
<ENTRY> non-NULL </ENTRY>
<ENTRY> return second argument if first is NULL </ENTRY>
<ENTRY> IFNULL(<replaceable class="parameter">c1</replaceable>, 'N/A')</ENTRY>
</ROW>
<ROW>
<ENTRY> CASE(WHEN <replaceable class="parameter">expr</replaceable> THEN <replaceable class="parameter">expr</replaceable> [...] ELSE <replaceable class="parameter">expr</replaceable> ) </ENTRY>
<ENTRY> <replaceable class="parameter">expr</replaceable> </ENTRY>
<ENTRY> return expression for first true clause </ENTRY>
<ENTRY> CASE(WHEN <replaceable class="parameter">c1</replaceable> = 1 THEN 'match' ELSE 'no match') </ENTRY>
</ROW>
</tbody>
</tgroup>
</table>
</para>
</sect1>
<sect1> <sect1>
<title id="math-funcs">Mathematical Functions</title> <title id="math-funcs">Mathematical Functions</title>
@ -257,7 +305,8 @@ Most functions explicitly defined for text will work for char() and varchar() ar
<title>Date/Time Functions</title> <title>Date/Time Functions</title>
<para> <para>
The date/time functions provide a powerful set of tools for manipulating various date/time types. The date/time functions provide a powerful set of tools
for manipulating various date/time types.
</para> </para>
<Para> <Para>
@ -373,8 +422,8 @@ or 'epoch' to return total elapsed seconds (for <Type>timespan</Type>).
<title>Geometric Functions</title> <title>Geometric Functions</title>
<para> <para>
The geometric types point, box, lseg, line, path, polygon, and circle have a large set of native The geometric types point, box, lseg, line, path, polygon, and
support functions. circle have a large set of native support functions.
</para> </para>
<Para> <Para>
@ -712,7 +761,7 @@ support functions.
<!-- 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
sgml-omittag:t sgml-omittag:nil
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t

@ -1,5 +1,5 @@
<Chapter Id="operators"> <Chapter Id="operators">
<Title>Operators</Title> <Title id="operators-title">Operators</Title>
<Abstract> <Abstract>
<Para> <Para>
@ -329,6 +329,7 @@ logical union
The operators listed here are defined for a number of native data types, The operators listed here are defined for a number of native data types,
ranging from numeric types to data/time types. ranging from numeric types to data/time types.
</para> </para>
<Para> <Para>
<TABLE TOCENTRY="1"> <TABLE TOCENTRY="1">
<TITLE><ProductName>Postgres</ProductName> Operators</TITLE> <TITLE><ProductName>Postgres</ProductName> Operators</TITLE>
@ -879,3 +880,19 @@ are several operators for this type.
</Chapter> </Chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
sgml-local-ecat-files:nil
End:
-->

@ -1,6 +1,16 @@
<chapter> <chapter>
<title>SQL Syntax</title> <title>SQL Syntax</title>
<abstract>
<para>
<acronym>SQL</acronym> manipulates sets of data. The language is
composed of various <firstterm>key words</firstterm>. Arithmetic
and procedural expressions are allowed. We will cover these topics
in this chapter; subsequent chapters will include details on data
types, functions, and operators.
</para>
</abstract>
<sect1> <sect1>
<title>Key Words</title> <title>Key Words</title>
@ -47,7 +57,8 @@ they are allowed to be column labels (i.e. in AS clauses).
Any string can be specified as an identifier if surrounded by Any string can be specified as an identifier if surrounded by
double quotes (<quote>like this!</quote>). Some care is required since double quotes (<quote>like this!</quote>). Some care is required since
such an identifier will be case sensitive such an identifier will be case sensitive
and will retain embedded whitespace other special characters.</para> and will retain embedded whitespace other special characters.
</para>
</tip> </tip>
<para> <para>
@ -82,7 +93,8 @@ are allowed to be present as column labels, but not as identifiers:
CASE COALESCE CROSS CURRENT CASE COALESCE CROSS CURRENT
ELSE END ELSE END
FALSE FOREIGN FALSE FOREIGN
GROUP GLOBAL GROUP
LOCAL
NULLIF NULLIF
ORDER ORDER
POSITION PRECISION POSITION PRECISION
@ -148,7 +160,7 @@ The following are either <acronym>SQL92</acronym>
or <acronym>SQL3</acronym> reserved key words or <acronym>SQL3</acronym> reserved key words
which are not key words in <productname>Postgres</productname>. which are not key words in <productname>Postgres</productname>.
These have no proscribed usage in <productname>Postgres</productname> These have no proscribed usage in <productname>Postgres</productname>
at the time of writing (v6.4) but may become reserved key words in the at the time of writing (v6.5) but may become reserved key words in the
future: future:
<note> <note>
@ -168,7 +180,7 @@ CASCADED CATALOG COLLATION CONNECT CONNECTION
DATE DEALLOCATE DEC DESCRIBE DESCRIPTOR DIAGNOSTICS DISCONNECT DOMAIN DATE DEALLOCATE DEC DESCRIBE DESCRIPTOR DIAGNOSTICS DISCONNECT DOMAIN
END-EXEC ESCAPE EXCEPT EXCEPTION EXEC EXTERNAL END-EXEC ESCAPE EXCEPT EXCEPTION EXEC EXTERNAL
FIRST FOUND FIRST FOUND
GET GLOBAL GO GOTO GET GO GOTO
IDENTITY IMMEDIATE INDICATOR INITIALLY INPUT INTERSECT ISOLATION IDENTITY IMMEDIATE INDICATOR INITIALLY INPUT INTERSECT ISOLATION
LAST LEVEL LOWER LAST LEVEL LOWER
MAX MIN MODULE MAX MIN MODULE
@ -205,21 +217,21 @@ non-reserved key words which are neither <acronym>SQL92</acronym>
nor <acronym>SQL3</acronym> non-reserved key words: nor <acronym>SQL3</acronym> non-reserved key words:
<programlisting> <programlisting>
AFTER AGGREGATE ACCESS AFTER AGGREGATE
BACKWARD BEFORE BACKWARD BEFORE
CACHE CREATEDB CREATEUSER CYCLE CACHE CREATEDB CREATEUSER CYCLE
DATABASE DELIMITERS DATABASE DELIMITERS
EACH ENCODING EACH ENCODING EXCLUSIVE
FORWARD FUNCTION FORWARD FUNCTION
HANDLER HANDLER
INCREMENT INDEX INHERITS INSENSITIVE INSTEAD ISNULL INCREMENT INDEX INHERITS INSENSITIVE INSTEAD ISNULL
LANCOMPILER LOCATION LANCOMPILER LOCATION
MAXVALUE MINVALUE MAXVALUE MINVALUE MODE
NOCREATEDB NOCREATEUSER NOTHING NOTNULL NOCREATEDB NOCREATEUSER NOTHING NOTNULL
OIDS OPERATOR OIDS OPERATOR
PASSWORD PROCEDURAL PASSWORD PROCEDURAL
RECIPE RENAME RETURNS ROW RULE RECIPE RENAME RETURNS ROW RULE
SEQUENCE SERIAL START STATEMENT STDIN STDOUT SEQUENCE SERIAL SHARE START STATEMENT STDIN STDOUT
TRUSTED TRUSTED
VALID VERSION VALID VERSION
</programlisting> </programlisting>
@ -255,7 +267,7 @@ non-reserved key words which are also either <acronym>SQL92</acronym>
or <acronym>SQL3</acronym> non-reserved key words: or <acronym>SQL3</acronym> non-reserved key words:
<programlisting> <programlisting>
TYPE COMMITTED SERIALIZABLE TYPE
</programlisting> </programlisting>
</para> </para>
@ -269,7 +281,7 @@ ADA
C CATALOG_NAME CHARACTER_SET_CATALOG CHARACTER_SET_NAME C CATALOG_NAME CHARACTER_SET_CATALOG CHARACTER_SET_NAME
CHARACTER_SET_SCHEMA CLASS_ORIGIN COBOL COLLATION_CATALOG CHARACTER_SET_SCHEMA CLASS_ORIGIN COBOL COLLATION_CATALOG
COLLATION_NAME COLLATION_SCHEMA COLUMN_NAME COLLATION_NAME COLLATION_SCHEMA COLUMN_NAME
COMMAND_FUNCTION COMMITTED CONDITION_NUMBER COMMAND_FUNCTION CONDITION_NUMBER
CONNECTION_NAME CONSTRAINT_CATALOG CONSTRAINT_NAME CONNECTION_NAME CONSTRAINT_CATALOG CONSTRAINT_NAME
CONSTRAINT_SCHEMA CURSOR_NAME CONSTRAINT_SCHEMA CURSOR_NAME
DATA DATE_TIME_INTERVAL_CODE DATE_TIME_INTERVAL_PRECISION DATA DATE_TIME_INTERVAL_CODE DATE_TIME_INTERVAL_PRECISION
@ -281,7 +293,7 @@ NAME NULLABLE NUMBER
PAD PASCAL PLI PAD PASCAL PLI
REPEATABLE RETURNED_LENGTH RETURNED_OCTET_LENGTH REPEATABLE RETURNED_LENGTH RETURNED_OCTET_LENGTH
RETURNED_SQLSTATE ROW_COUNT RETURNED_SQLSTATE ROW_COUNT
SCALE SCHEMA_NAME SERIALIZABLE SERVER_NAME SPACE SCALE SCHEMA_NAME SERVER_NAME SPACE
SUBCLASS_ORIGIN SUBCLASS_ORIGIN
TABLE_NAME TABLE_NAME
UNCOMMITTED UNNAMED UNCOMMITTED UNNAMED
@ -289,6 +301,20 @@ UNCOMMITTED UNNAMED
</para> </para>
</sect2> </sect2>
</sect1> </sect1>
<sect1>
<title>Expressions</title>
<para>
<acronym>SQL92</acronym> allows <firstterm>expressions</firstterm>
to transform data in expressions. Expressions may contain operators
(see <xref linkend="operators-title" endterm="operators-title">
for more details) and functions
(<xref linkend="functions-title" endterm="functions-title"> has
more information).
</para>
</sect1>
</chapter> </chapter>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file