1- <chapter id="syntax" >
1+ <chapter>
22<title>SQL Syntax</title>
33
44<sect1>
@@ -13,22 +13,25 @@ restricted to appear in only certain contexts. Other key words are
1313<firstterm>not restricted</firstterm>, which indicates that in certain
1414contexts they
1515have a specific meaning but are not otherwise constrained.
16+ </para>
1617
1718<para>
1819<productname>Postgres</productname> implements an extended subset of the
1920<acronym>SQL92</acronym> and <acronym>SQL3</acronym> languages. Some language
2021elements are not as restricted in this implementation as is
2122called for in the language standards, in part due
2223to the extensibility features of <productname>Postgres</productname>.
24+ </para>
2325
2426<para>
2527Information on <acronym>SQL92</acronym> and <acronym>SQL3</acronym> key words
26- is derived from <xref linkend="DATE97" endterm="DATE97-full">.
28+ is derived from <xref linkend="DATE97" endterm="DATE97">.
29+ </para>
2730
28- <Sect2 >
29- <Title >Reserved Key Words</Title >
31+ <sect2 >
32+ <title >Reserved Key Words</title >
3033
31- <Para >
34+ <para >
3235<acronym>SQL92</acronym> and <acronym>SQL3</acronym> have
3336<firstterm>reserved key words</firstterm> which are not allowed
3437as identifiers and not allowed in any usage other than as fundamental
@@ -37,13 +40,14 @@ tokens in <acronym>SQL</acronym> statements.
3740which have similar restrictions. In particular, these key words
3841are not allowed as column or table names, though in some cases
3942they are allowed to be column labels (i.e. in AS clauses).
43+ </para>
4044
4145<tip>
4246<para>
4347Any string can be specified as an identifier if surrounded by
4448double quotes (<quote>like this!</quote>). Some care is required since
4549such an identifier will be case sensitive
46- and will retain embedded whitespace other special characters.
50+ and will retain embedded whitespace other special characters.</para>
4751</tip>
4852
4953<para>
@@ -66,7 +70,9 @@ SETOF SHOW
6670UNLISTEN UNTIL
6771VACUUM VERBOSE
6872</programlisting>
73+ </para>
6974
75+ <para>
7076The following are <productname>Postgres</productname>
7177reserved words which are also <acronym>SQL92</acronym>
7278or <acronym>SQL3</acronym> reserved words, and which
@@ -113,7 +119,9 @@ UNION UNIQUE UPDATE USER USING
113119VALUES VARCHAR VARYING VIEW
114120WHERE WITH WORK
115121</programlisting>
122+ </para>
116123
124+ <para>
117125The following are <acronym>SQL92</acronym> reserved key words which
118126are not <productname>Postgres</productname> reserved key words, but which
119127if used as function names are always translated into the function
@@ -122,7 +130,9 @@ if used as function names are always translated into the function
122130<programlisting>
123131CHAR_LENGTH CHARACTER_LENGTH
124132</programlisting>
133+ </para>
125134
135+ <para>
126136The following are <acronym>SQL92</acronym> or <acronym>SQL3</acronym>
127137reserved key words which
128138are not <productname>Postgres</productname> reserved key words, but
@@ -131,6 +141,7 @@ if used as type names are always translated into an alternate, native type:
131141<programlisting>
132142BOOLEAN DOUBLE FLOAT INT INTEGER INTERVAL REAL SMALLINT
133143</programlisting>
144+ </para>
134145
135146<para>
136147The following are either <acronym>SQL92</acronym>
@@ -146,6 +157,7 @@ Some of these key words represent functions in <acronym>SQL92</acronym>.
146157These functions are defined in <productname>Postgres</productname>,
147158but the parser does not consider the names to be key words and they are allowed
148159in other contexts.
160+ </para>
149161</note>
150162
151163<programlisting>
@@ -170,11 +182,13 @@ UNKNOWN UPPER USAGE
170182VALUE
171183WHENEVER WRITE
172184</programlisting>
185+ </para>
186+ </sect2>
173187
174- <Sect2 >
175- <Title >Non-reserved Keywords</Title >
188+ <sect2 >
189+ <title >Non-reserved Keywords</title >
176190
177- <Para >
191+ <para >
178192<acronym>SQL92</acronym> and <acronym>SQL3</acronym> have
179193<firstterm>non-reserved keywords</firstterm> which have
180194a proscribed meaning in the language but which are also allowed
@@ -183,6 +197,7 @@ as identifiers.
183197which allow similar unrestricted usage.
184198In particular, these keywords
185199are allowed as column or table names.
200+ </para>
186201
187202<para>
188203The following are <productname>Postgres</productname>
@@ -208,6 +223,7 @@ SEQUENCE SERIAL START STATEMENT STDIN STDOUT
208223TRUSTED
209224VALID VERSION
210225</programlisting>
226+ </para>
211227
212228<para>
213229The following are <productname>Postgres</productname>
@@ -231,6 +247,7 @@ TIME TIMESTAMP TIMEZONE_HOUR TIMEZONE_MINUTE TRIGGER
231247YEAR
232248ZONE
233249</programlisting>
250+ </para>
234251
235252<para>
236253The following are <productname>Postgres</productname>
@@ -240,6 +257,7 @@ or <acronym>SQL3</acronym> non-reserved key words:
240257<programlisting>
241258TYPE
242259</programlisting>
260+ </para>
243261
244262<para>
245263The following are either <acronym>SQL92</acronym>
@@ -268,3 +286,24 @@ SUBCLASS_ORIGIN
268286TABLE_NAME
269287UNCOMMITTED UNNAMED
270288</programlisting>
289+ </para>
290+ </sect2>
291+ </sect1>
292+ </chapter>
293+
294+ <!-- Keep this comment at the end of the file
295+ Local variables:
296+ mode: sgml
297+ sgml-omittag:nil
298+ sgml-shorttag:t
299+ sgml-minimize-attributes:nil
300+ sgml-always-quote-attributes:t
301+ sgml-indent-step:1
302+ sgml-indent-data:t
303+ sgml-parent-document:nil
304+ sgml-default-dtd-file:"./reference.ced"
305+ sgml-exposed-tags:nil
306+ sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
307+ sgml-local-ecat-files:nil
308+ End:
309+ -->