mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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:
@ -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.
|
||||
Derived from postgres.sgml.
|
||||
- thomas 1998-10-27
|
||||
|
||||
$Log: admin.sgml,v $
|
||||
Revision 1.11 1999/05/04 02:16:57 thomas
|
||||
Include chapter on security.
|
||||
Revision 1.12 1999/05/12 07:32:42 thomas
|
||||
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
|
||||
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>
|
||||
-->
|
||||
|
||||
<Date>(last updated 1998-10-27)</Date>
|
||||
<Date>(last updated 1999-04-08)</Date>
|
||||
</BookBiblio>
|
||||
|
||||
<LegalNotice>
|
||||
<Para>
|
||||
<ProductName>PostgreSQL</ProductName> is copyright (C) 1998
|
||||
<ProductName>PostgreSQL</ProductName> is copyright (C) 1998-9
|
||||
by the Postgres Global Development Group.
|
||||
</Para>
|
||||
</LegalNotice>
|
||||
|
@ -2,7 +2,8 @@
|
||||
<title>Bibliography</title>
|
||||
|
||||
<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>
|
||||
|
||||
<bibliodiv>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Chapter Id="functions">
|
||||
<Title>Functions</Title>
|
||||
<Title id="functions-title">Functions</Title>
|
||||
|
||||
<Abstract>
|
||||
<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.
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
@ -373,8 +422,8 @@ or 'epoch' to return total elapsed seconds (for <Type>timespan</Type>).
|
||||
<title>Geometric Functions</title>
|
||||
|
||||
<para>
|
||||
The geometric types point, box, lseg, line, path, polygon, and circle have a large set of native
|
||||
support functions.
|
||||
The geometric types point, box, lseg, line, path, polygon, and
|
||||
circle have a large set of native support functions.
|
||||
</para>
|
||||
|
||||
<Para>
|
||||
@ -712,7 +761,7 @@ support functions.
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Chapter Id="operators">
|
||||
<Title>Operators</Title>
|
||||
<Title id="operators-title">Operators</Title>
|
||||
|
||||
<Abstract>
|
||||
<Para>
|
||||
@ -329,6 +329,7 @@ logical union
|
||||
The operators listed here are defined for a number of native data types,
|
||||
ranging from numeric types to data/time types.
|
||||
</para>
|
||||
|
||||
<Para>
|
||||
<TABLE TOCENTRY="1">
|
||||
<TITLE><ProductName>Postgres</ProductName> Operators</TITLE>
|
||||
@ -879,3 +880,19 @@ are several operators for this type.
|
||||
|
||||
</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>
|
||||
<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>
|
||||
<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
|
||||
double quotes (<quote>like this!</quote>). Some care is required since
|
||||
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>
|
||||
|
||||
<para>
|
||||
@ -82,7 +93,8 @@ are allowed to be present as column labels, but not as identifiers:
|
||||
CASE COALESCE CROSS CURRENT
|
||||
ELSE END
|
||||
FALSE FOREIGN
|
||||
GROUP
|
||||
GLOBAL GROUP
|
||||
LOCAL
|
||||
NULLIF
|
||||
ORDER
|
||||
POSITION PRECISION
|
||||
@ -148,7 +160,7 @@ The following are either <acronym>SQL92</acronym>
|
||||
or <acronym>SQL3</acronym> reserved key words
|
||||
which are not key words 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:
|
||||
|
||||
<note>
|
||||
@ -168,7 +180,7 @@ CASCADED CATALOG COLLATION CONNECT CONNECTION
|
||||
DATE DEALLOCATE DEC DESCRIBE DESCRIPTOR DIAGNOSTICS DISCONNECT DOMAIN
|
||||
END-EXEC ESCAPE EXCEPT EXCEPTION EXEC EXTERNAL
|
||||
FIRST FOUND
|
||||
GET GLOBAL GO GOTO
|
||||
GET GO GOTO
|
||||
IDENTITY IMMEDIATE INDICATOR INITIALLY INPUT INTERSECT ISOLATION
|
||||
LAST LEVEL LOWER
|
||||
MAX MIN MODULE
|
||||
@ -205,21 +217,21 @@ non-reserved key words which are neither <acronym>SQL92</acronym>
|
||||
nor <acronym>SQL3</acronym> non-reserved key words:
|
||||
|
||||
<programlisting>
|
||||
AFTER AGGREGATE
|
||||
ACCESS AFTER AGGREGATE
|
||||
BACKWARD BEFORE
|
||||
CACHE CREATEDB CREATEUSER CYCLE
|
||||
DATABASE DELIMITERS
|
||||
EACH ENCODING
|
||||
EACH ENCODING EXCLUSIVE
|
||||
FORWARD FUNCTION
|
||||
HANDLER
|
||||
INCREMENT INDEX INHERITS INSENSITIVE INSTEAD ISNULL
|
||||
LANCOMPILER LOCATION
|
||||
MAXVALUE MINVALUE
|
||||
MAXVALUE MINVALUE MODE
|
||||
NOCREATEDB NOCREATEUSER NOTHING NOTNULL
|
||||
OIDS OPERATOR
|
||||
PASSWORD PROCEDURAL
|
||||
RECIPE RENAME RETURNS ROW RULE
|
||||
SEQUENCE SERIAL START STATEMENT STDIN STDOUT
|
||||
SEQUENCE SERIAL SHARE START STATEMENT STDIN STDOUT
|
||||
TRUSTED
|
||||
VALID VERSION
|
||||
</programlisting>
|
||||
@ -255,7 +267,7 @@ non-reserved key words which are also either <acronym>SQL92</acronym>
|
||||
or <acronym>SQL3</acronym> non-reserved key words:
|
||||
|
||||
<programlisting>
|
||||
TYPE
|
||||
COMMITTED SERIALIZABLE TYPE
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
@ -269,7 +281,7 @@ ADA
|
||||
C CATALOG_NAME CHARACTER_SET_CATALOG CHARACTER_SET_NAME
|
||||
CHARACTER_SET_SCHEMA CLASS_ORIGIN COBOL COLLATION_CATALOG
|
||||
COLLATION_NAME COLLATION_SCHEMA COLUMN_NAME
|
||||
COMMAND_FUNCTION COMMITTED CONDITION_NUMBER
|
||||
COMMAND_FUNCTION CONDITION_NUMBER
|
||||
CONNECTION_NAME CONSTRAINT_CATALOG CONSTRAINT_NAME
|
||||
CONSTRAINT_SCHEMA CURSOR_NAME
|
||||
DATA DATE_TIME_INTERVAL_CODE DATE_TIME_INTERVAL_PRECISION
|
||||
@ -281,7 +293,7 @@ NAME NULLABLE NUMBER
|
||||
PAD PASCAL PLI
|
||||
REPEATABLE RETURNED_LENGTH RETURNED_OCTET_LENGTH
|
||||
RETURNED_SQLSTATE ROW_COUNT
|
||||
SCALE SCHEMA_NAME SERIALIZABLE SERVER_NAME SPACE
|
||||
SCALE SCHEMA_NAME SERVER_NAME SPACE
|
||||
SUBCLASS_ORIGIN
|
||||
TABLE_NAME
|
||||
UNCOMMITTED UNNAMED
|
||||
@ -289,6 +301,20 @@ UNCOMMITTED UNNAMED
|
||||
</para>
|
||||
</sect2>
|
||||
</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>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
Reference in New Issue
Block a user