1
- <chapter id="syntax" >
1
+ <chapter>
2
2
<title>SQL Syntax</title>
3
3
4
4
<sect1>
@@ -13,22 +13,25 @@ restricted to appear in only certain contexts. Other key words are
13
13
<firstterm>not restricted</firstterm>, which indicates that in certain
14
14
contexts they
15
15
have a specific meaning but are not otherwise constrained.
16
+ </para>
16
17
17
18
<para>
18
19
<productname>Postgres</productname> implements an extended subset of the
19
20
<acronym>SQL92</acronym> and <acronym>SQL3</acronym> languages. Some language
20
21
elements are not as restricted in this implementation as is
21
22
called for in the language standards, in part due
22
23
to the extensibility features of <productname>Postgres</productname>.
24
+ </para>
23
25
24
26
<para>
25
27
Information 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>
27
30
28
- <Sect2 >
29
- <Title >Reserved Key Words</Title >
31
+ <sect2 >
32
+ <title >Reserved Key Words</title >
30
33
31
- <Para >
34
+ <para >
32
35
<acronym>SQL92</acronym> and <acronym>SQL3</acronym> have
33
36
<firstterm>reserved key words</firstterm> which are not allowed
34
37
as identifiers and not allowed in any usage other than as fundamental
@@ -37,13 +40,14 @@ tokens in <acronym>SQL</acronym> statements.
37
40
which have similar restrictions. In particular, these key words
38
41
are not allowed as column or table names, though in some cases
39
42
they are allowed to be column labels (i.e. in AS clauses).
43
+ </para>
40
44
41
45
<tip>
42
46
<para>
43
47
Any string can be specified as an identifier if surrounded by
44
48
double quotes (<quote>like this!</quote>). Some care is required since
45
49
such 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>
47
51
</tip>
48
52
49
53
<para>
@@ -66,7 +70,9 @@ SETOF SHOW
66
70
UNLISTEN UNTIL
67
71
VACUUM VERBOSE
68
72
</programlisting>
73
+ </para>
69
74
75
+ <para>
70
76
The following are <productname>Postgres</productname>
71
77
reserved words which are also <acronym>SQL92</acronym>
72
78
or <acronym>SQL3</acronym> reserved words, and which
@@ -113,7 +119,9 @@ UNION UNIQUE UPDATE USER USING
113
119
VALUES VARCHAR VARYING VIEW
114
120
WHERE WITH WORK
115
121
</programlisting>
122
+ </para>
116
123
124
+ <para>
117
125
The following are <acronym>SQL92</acronym> reserved key words which
118
126
are not <productname>Postgres</productname> reserved key words, but which
119
127
if 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
122
130
<programlisting>
123
131
CHAR_LENGTH CHARACTER_LENGTH
124
132
</programlisting>
133
+ </para>
125
134
135
+ <para>
126
136
The following are <acronym>SQL92</acronym> or <acronym>SQL3</acronym>
127
137
reserved key words which
128
138
are 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:
131
141
<programlisting>
132
142
BOOLEAN DOUBLE FLOAT INT INTEGER INTERVAL REAL SMALLINT
133
143
</programlisting>
144
+ </para>
134
145
135
146
<para>
136
147
The following are either <acronym>SQL92</acronym>
@@ -146,6 +157,7 @@ Some of these key words represent functions in <acronym>SQL92</acronym>.
146
157
These functions are defined in <productname>Postgres</productname>,
147
158
but the parser does not consider the names to be key words and they are allowed
148
159
in other contexts.
160
+ </para>
149
161
</note>
150
162
151
163
<programlisting>
@@ -170,11 +182,13 @@ UNKNOWN UPPER USAGE
170
182
VALUE
171
183
WHENEVER WRITE
172
184
</programlisting>
185
+ </para>
186
+ </sect2>
173
187
174
- <Sect2 >
175
- <Title >Non-reserved Keywords</Title >
188
+ <sect2 >
189
+ <title >Non-reserved Keywords</title >
176
190
177
- <Para >
191
+ <para >
178
192
<acronym>SQL92</acronym> and <acronym>SQL3</acronym> have
179
193
<firstterm>non-reserved keywords</firstterm> which have
180
194
a proscribed meaning in the language but which are also allowed
@@ -183,6 +197,7 @@ as identifiers.
183
197
which allow similar unrestricted usage.
184
198
In particular, these keywords
185
199
are allowed as column or table names.
200
+ </para>
186
201
187
202
<para>
188
203
The following are <productname>Postgres</productname>
@@ -208,6 +223,7 @@ SEQUENCE SERIAL START STATEMENT STDIN STDOUT
208
223
TRUSTED
209
224
VALID VERSION
210
225
</programlisting>
226
+ </para>
211
227
212
228
<para>
213
229
The following are <productname>Postgres</productname>
@@ -231,6 +247,7 @@ TIME TIMESTAMP TIMEZONE_HOUR TIMEZONE_MINUTE TRIGGER
231
247
YEAR
232
248
ZONE
233
249
</programlisting>
250
+ </para>
234
251
235
252
<para>
236
253
The following are <productname>Postgres</productname>
@@ -240,6 +257,7 @@ or <acronym>SQL3</acronym> non-reserved key words:
240
257
<programlisting>
241
258
TYPE
242
259
</programlisting>
260
+ </para>
243
261
244
262
<para>
245
263
The following are either <acronym>SQL92</acronym>
@@ -268,3 +286,24 @@ SUBCLASS_ORIGIN
268
286
TABLE_NAME
269
287
UNCOMMITTED UNNAMED
270
288
</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
+ -->
0 commit comments