1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/advanced.sgml,v 1.9 2000/03/31 03:27:40 thomas Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/advanced.sgml,v 1.10 2000/04/07 13:30:58 thomas Exp $
3
3
-->
4
4
5
5
<chapter id="advanced">
@@ -106,10 +106,10 @@ SELECT c.name, c.altitude
106
106
Here the <quote>*</quote> after cities indicates that the query should
107
107
be run over cities and all classes below cities in the
108
108
inheritance hierarchy. Many of the commands that we
109
- have already discussed (<command>select </command>,
110
- <command>update </command> and <command>delete </command>)
109
+ have already discussed (<command>SELECT </command>,
110
+ <command>UPDATE </command> and <command>DELETE </command>)
111
111
support this <quote>*</quote> notation, as do others, like
112
- <command>alter </command>.
112
+ <command>ALTER </command>.
113
113
</para>
114
114
</sect1>
115
115
@@ -118,7 +118,8 @@ SELECT c.name, c.altitude
118
118
119
119
<para>
120
120
One of the tenets of the relational model is that the
121
- attributes of a relation are atomic. <productname>Postgres</productname> does not
121
+ attributes of a relation are atomic.
122
+ <productname>Postgres</productname> does not
122
123
have this restriction; attributes can themselves contain
123
124
sub-values that can be accessed from the query
124
125
language. For example, you can create attributes that
@@ -129,7 +130,8 @@ SELECT c.name, c.altitude
129
130
<title>Arrays</title>
130
131
131
132
<para>
132
- <productname>Postgres</productname> allows attributes of an instance to be defined
133
+ <productname>Postgres</productname> allows attributes of an
134
+ instance to be defined
133
135
as fixed-length or variable-length multi-dimensional
134
136
arrays. Arrays of any base type or user-defined type
135
137
can be created. To illustrate their use, we first create a
@@ -149,11 +151,14 @@ CREATE TABLE SAL_EMP (
149
151
a <firstterm>text</firstterm> string (name), a one-dimensional
150
152
array of <firstterm>int4</firstterm>
151
153
(pay_by_quarter), which represents the employee's
152
- salary by quarter and a two-dimensional array of <firstterm>text</firstterm>
154
+ salary by quarter and a two-dimensional array of
155
+ <firstterm>text</firstterm>
153
156
(schedule), which represents the employee's weekly
154
- schedule. Now we do some <firstterm>INSERTS</firstterm>s; note that when
157
+ schedule. Now we do some <firstterm>INSERTS</firstterm>s;
158
+ note that when
155
159
appending to an array, we enclose the values within
156
- braces and separate them by commas. If you know <firstterm>C</firstterm>,
160
+ braces and separate them by commas. If you know
161
+ <firstterm>C</firstterm>,
157
162
this is not unlike the syntax for initializing structures.
158
163
159
164
<programlisting>
@@ -168,7 +173,8 @@ INSERT INTO SAL_EMP
168
173
'{{"talk", "consult"}, {"meeting"}}');
169
174
</programlisting>
170
175
171
- By default, <productname>Postgres</productname> uses the "one-based" numbering
176
+ By default, <productname>Postgres</productname> uses the
177
+ "one-based" numbering
172
178
convention for arrays -- that is, an array of n elements
173
179
starts with array[1] and ends with array[n].
174
180
Now, we can run some queries on SAL_EMP. First, we
@@ -228,6 +234,11 @@ SELECT SAL_EMP.schedule[1:2][1:1]
228
234
</sect2>
229
235
</sect1>
230
236
237
+ <!--
238
+
239
+ We haven't had Time Travel for two or three years, so let's stop
240
+ mentioning it. - thomas 2000-04-02
241
+
231
242
<sect1>
232
243
<title>Time Travel</title>
233
244
@@ -240,21 +251,27 @@ SELECT SAL_EMP.schedule[1:2][1:1]
240
251
</para>
241
252
242
253
<para>
243
- New features such as triggers allow one to mimic the behavior of time travel when desired, without
244
- incurring the overhead when it is not needed (for most users, this is most of the time).
245
- See examples in the <filename>contrib</filename> directory for more information.
254
+ New features such as triggers allow one to mimic the behavior of
255
+ time travel when desired, without
256
+ incurring the overhead when it is not needed (for most users, this
257
+ is most of the time).
258
+ See examples in the <filename>contrib</filename> directory for
259
+ more information.
246
260
</para>
247
261
248
262
<note>
249
263
<title>Time travel is deprecated</title>
250
264
<para>
251
- The remaining text in this section is retained only until it can be rewritten in the context
252
- of new techniques to accomplish the same purpose. Volunteers? - thomas 1998-01-12
265
+ The remaining text in this section is retained only until it can
266
+ be rewritten in the context
267
+ of new techniques to accomplish the same purpose.
268
+ Volunteers? - thomas 1998-01-12
253
269
</para>
254
270
</note>
255
271
256
272
<para>
257
- <productname>Postgres</productname> supports the notion of time travel. This feature
273
+ <productname>Postgres</productname> supports the notion of time
274
+ travel. This feature
258
275
allows a user to run historical queries. For
259
276
example, to find the current population of Mariposa
260
277
city, one would query:
@@ -269,7 +286,8 @@ SELECT * FROM cities WHERE name = 'Mariposa';
269
286
+---------+------------+----------+
270
287
</programlisting>
271
288
272
- <productname>Postgres</productname> will automatically find the version of Mariposa's
289
+ <productname>Postgres</productname> will automatically find the
290
+ version of Mariposa's
273
291
record valid at the current time.
274
292
One can also give a time range. For example to see the
275
293
past and present populations of Mariposa, one would
@@ -313,18 +331,22 @@ SELECT name, population
313
331
abbreviated as ``[,].''
314
332
</para>
315
333
</sect1>
334
+ -->
316
335
317
336
<sect1>
318
337
<title>More Advanced Features</title>
319
338
320
339
<para>
321
- <productname>Postgres</productname> has many features not touched upon in this
340
+ <productname>Postgres</productname> has many features not touched
341
+ upon in this
322
342
tutorial introduction, which has been oriented toward newer users of
323
343
<acronym>SQL</acronym>.
324
- These are discussed in more detail in both the User's and Programmer's Guides.
344
+ These are discussed in more detail in both the User's and
345
+ Programmer's Guides.
325
346
</para>
326
347
327
348
</sect1>
349
+
328
350
</chapter>
329
351
330
352
<!-- Keep this comment at the end of the file
0 commit comments