@@ -3150,7 +3150,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
3150
3150
CREATE TABLE cities (
3151
3151
name text,
3152
3152
population float,
3153
- altitude int -- in feet
3153
+ elevation int -- in feet
3154
3154
);
3155
3155
3156
3156
CREATE TABLE capitals (
@@ -3170,40 +3170,40 @@ CREATE TABLE capitals (
3170
3170
rows of a table or all rows of a table plus all of its descendant tables.
3171
3171
The latter behavior is the default.
3172
3172
For example, the following query finds the names of all cities,
3173
- including state capitals, that are located at an altitude over
3173
+ including state capitals, that are located at an elevation over
3174
3174
500 feet:
3175
3175
3176
3176
<programlisting>
3177
- SELECT name, altitude
3177
+ SELECT name, elevation
3178
3178
FROM cities
3179
- WHERE altitude > 500;
3179
+ WHERE elevation > 500;
3180
3180
</programlisting>
3181
3181
3182
3182
Given the sample data from the <productname>PostgreSQL</productname>
3183
3183
tutorial (see <xref linkend="tutorial-sql-intro"/>), this returns:
3184
3184
3185
3185
<programlisting>
3186
- name | altitude
3187
- -----------+----------
3188
- Las Vegas | 2174
3189
- Mariposa | 1953
3190
- Madison | 845
3186
+ name | elevation
3187
+ -----------+-----------
3188
+ Las Vegas | 2174
3189
+ Mariposa | 1953
3190
+ Madison | 845
3191
3191
</programlisting>
3192
3192
</para>
3193
3193
3194
3194
<para>
3195
3195
On the other hand, the following query finds all the cities that
3196
- are not state capitals and are situated at an altitude over 500 feet:
3196
+ are not state capitals and are situated at an elevation over 500 feet:
3197
3197
3198
3198
<programlisting>
3199
- SELECT name, altitude
3199
+ SELECT name, elevation
3200
3200
FROM ONLY cities
3201
- WHERE altitude > 500;
3201
+ WHERE elevation > 500;
3202
3202
3203
- name | altitude
3204
- -----------+----------
3205
- Las Vegas | 2174
3206
- Mariposa | 1953
3203
+ name | elevation
3204
+ -----------+-----------
3205
+ Las Vegas | 2174
3206
+ Mariposa | 1953
3207
3207
</programlisting>
3208
3208
</para>
3209
3209
@@ -3222,9 +3222,9 @@ SELECT name, altitude
3222
3222
to explicitly specify that descendant tables are included:
3223
3223
3224
3224
<programlisting>
3225
- SELECT name, altitude
3225
+ SELECT name, elevation
3226
3226
FROM cities*
3227
- WHERE altitude > 500;
3227
+ WHERE elevation > 500;
3228
3228
</programlisting>
3229
3229
3230
3230
Writing <literal>*</literal> is not necessary, since this behavior is always
@@ -3239,39 +3239,39 @@ SELECT name, altitude
3239
3239
originating table:
3240
3240
3241
3241
<programlisting>
3242
- SELECT c.tableoid, c.name, c.altitude
3242
+ SELECT c.tableoid, c.name, c.elevation
3243
3243
FROM cities c
3244
- WHERE c.altitude > 500;
3244
+ WHERE c.elevation > 500;
3245
3245
</programlisting>
3246
3246
3247
3247
which returns:
3248
3248
3249
3249
<programlisting>
3250
- tableoid | name | altitude
3251
- ----------+-----------+----------
3252
- 139793 | Las Vegas | 2174
3253
- 139793 | Mariposa | 1953
3254
- 139798 | Madison | 845
3250
+ tableoid | name | elevation
3251
+ ----------+-----------+-----------
3252
+ 139793 | Las Vegas | 2174
3253
+ 139793 | Mariposa | 1953
3254
+ 139798 | Madison | 845
3255
3255
</programlisting>
3256
3256
3257
3257
(If you try to reproduce this example, you will probably get
3258
3258
different numeric OIDs.) By doing a join with
3259
3259
<structname>pg_class</structname> you can see the actual table names:
3260
3260
3261
3261
<programlisting>
3262
- SELECT p.relname, c.name, c.altitude
3262
+ SELECT p.relname, c.name, c.elevation
3263
3263
FROM cities c, pg_class p
3264
- WHERE c.altitude > 500 AND c.tableoid = p.oid;
3264
+ WHERE c.elevation > 500 AND c.tableoid = p.oid;
3265
3265
</programlisting>
3266
3266
3267
3267
which returns:
3268
3268
3269
3269
<programlisting>
3270
- relname | name | altitude
3271
- ----------+-----------+----------
3272
- cities | Las Vegas | 2174
3273
- cities | Mariposa | 1953
3274
- capitals | Madison | 845
3270
+ relname | name | elevation
3271
+ ----------+-----------+-----------
3272
+ cities | Las Vegas | 2174
3273
+ cities | Mariposa | 1953
3274
+ capitals | Madison | 845
3275
3275
</programlisting>
3276
3276
</para>
3277
3277
@@ -3280,9 +3280,9 @@ WHERE c.altitude > 500 AND c.tableoid = p.oid;
3280
3280
alias type, which will print the table OID symbolically:
3281
3281
3282
3282
<programlisting>
3283
- SELECT c.tableoid::regclass, c.name, c.altitude
3283
+ SELECT c.tableoid::regclass, c.name, c.elevation
3284
3284
FROM cities c
3285
- WHERE c.altitude > 500;
3285
+ WHERE c.elevation > 500;
3286
3286
</programlisting>
3287
3287
</para>
3288
3288
@@ -3292,7 +3292,7 @@ WHERE c.altitude > 500;
3292
3292
other tables in the inheritance hierarchy. In our example, the
3293
3293
following <command>INSERT</command> statement will fail:
3294
3294
<programlisting>
3295
- INSERT INTO cities (name, population, altitude , state)
3295
+ INSERT INTO cities (name, population, elevation , state)
3296
3296
VALUES ('Albany', NULL, NULL, 'NY');
3297
3297
</programlisting>
3298
3298
We might hope that the data would somehow be routed to the
0 commit comments