@@ -3157,7 +3157,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
3157
3157
CREATE TABLE cities (
3158
3158
name text,
3159
3159
population float,
3160
- altitude int -- in feet
3160
+ elevation int -- in feet
3161
3161
);
3162
3162
3163
3163
CREATE TABLE capitals (
@@ -3177,40 +3177,40 @@ CREATE TABLE capitals (
3177
3177
rows of a table or all rows of a table plus all of its descendant tables.
3178
3178
The latter behavior is the default.
3179
3179
For example, the following query finds the names of all cities,
3180
- including state capitals, that are located at an altitude over
3180
+ including state capitals, that are located at an elevation over
3181
3181
500 feet:
3182
3182
3183
3183
<programlisting>
3184
- SELECT name, altitude
3184
+ SELECT name, elevation
3185
3185
FROM cities
3186
- WHERE altitude > 500;
3186
+ WHERE elevation > 500;
3187
3187
</programlisting>
3188
3188
3189
3189
Given the sample data from the <productname>PostgreSQL</productname>
3190
3190
tutorial (see <xref linkend="tutorial-sql-intro"/>), this returns:
3191
3191
3192
3192
<programlisting>
3193
- name | altitude
3194
- -----------+----------
3195
- Las Vegas | 2174
3196
- Mariposa | 1953
3197
- Madison | 845
3193
+ name | elevation
3194
+ -----------+-----------
3195
+ Las Vegas | 2174
3196
+ Mariposa | 1953
3197
+ Madison | 845
3198
3198
</programlisting>
3199
3199
</para>
3200
3200
3201
3201
<para>
3202
3202
On the other hand, the following query finds all the cities that
3203
- are not state capitals and are situated at an altitude over 500 feet:
3203
+ are not state capitals and are situated at an elevation over 500 feet:
3204
3204
3205
3205
<programlisting>
3206
- SELECT name, altitude
3206
+ SELECT name, elevation
3207
3207
FROM ONLY cities
3208
- WHERE altitude > 500;
3208
+ WHERE elevation > 500;
3209
3209
3210
- name | altitude
3211
- -----------+----------
3212
- Las Vegas | 2174
3213
- Mariposa | 1953
3210
+ name | elevation
3211
+ -----------+-----------
3212
+ Las Vegas | 2174
3213
+ Mariposa | 1953
3214
3214
</programlisting>
3215
3215
</para>
3216
3216
@@ -3229,9 +3229,9 @@ SELECT name, altitude
3229
3229
to explicitly specify that descendant tables are included:
3230
3230
3231
3231
<programlisting>
3232
- SELECT name, altitude
3232
+ SELECT name, elevation
3233
3233
FROM cities*
3234
- WHERE altitude > 500;
3234
+ WHERE elevation > 500;
3235
3235
</programlisting>
3236
3236
3237
3237
Writing <literal>*</literal> is not necessary, since this behavior is always
@@ -3246,39 +3246,39 @@ SELECT name, altitude
3246
3246
originating table:
3247
3247
3248
3248
<programlisting>
3249
- SELECT c.tableoid, c.name, c.altitude
3249
+ SELECT c.tableoid, c.name, c.elevation
3250
3250
FROM cities c
3251
- WHERE c.altitude > 500;
3251
+ WHERE c.elevation > 500;
3252
3252
</programlisting>
3253
3253
3254
3254
which returns:
3255
3255
3256
3256
<programlisting>
3257
- tableoid | name | altitude
3258
- ----------+-----------+----------
3259
- 139793 | Las Vegas | 2174
3260
- 139793 | Mariposa | 1953
3261
- 139798 | Madison | 845
3257
+ tableoid | name | elevation
3258
+ ----------+-----------+-----------
3259
+ 139793 | Las Vegas | 2174
3260
+ 139793 | Mariposa | 1953
3261
+ 139798 | Madison | 845
3262
3262
</programlisting>
3263
3263
3264
3264
(If you try to reproduce this example, you will probably get
3265
3265
different numeric OIDs.) By doing a join with
3266
3266
<structname>pg_class</structname> you can see the actual table names:
3267
3267
3268
3268
<programlisting>
3269
- SELECT p.relname, c.name, c.altitude
3269
+ SELECT p.relname, c.name, c.elevation
3270
3270
FROM cities c, pg_class p
3271
- WHERE c.altitude > 500 AND c.tableoid = p.oid;
3271
+ WHERE c.elevation > 500 AND c.tableoid = p.oid;
3272
3272
</programlisting>
3273
3273
3274
3274
which returns:
3275
3275
3276
3276
<programlisting>
3277
- relname | name | altitude
3278
- ----------+-----------+----------
3279
- cities | Las Vegas | 2174
3280
- cities | Mariposa | 1953
3281
- capitals | Madison | 845
3277
+ relname | name | elevation
3278
+ ----------+-----------+-----------
3279
+ cities | Las Vegas | 2174
3280
+ cities | Mariposa | 1953
3281
+ capitals | Madison | 845
3282
3282
</programlisting>
3283
3283
</para>
3284
3284
@@ -3287,9 +3287,9 @@ WHERE c.altitude > 500 AND c.tableoid = p.oid;
3287
3287
alias type, which will print the table OID symbolically:
3288
3288
3289
3289
<programlisting>
3290
- SELECT c.tableoid::regclass, c.name, c.altitude
3290
+ SELECT c.tableoid::regclass, c.name, c.elevation
3291
3291
FROM cities c
3292
- WHERE c.altitude > 500;
3292
+ WHERE c.elevation > 500;
3293
3293
</programlisting>
3294
3294
</para>
3295
3295
@@ -3299,7 +3299,7 @@ WHERE c.altitude > 500;
3299
3299
other tables in the inheritance hierarchy. In our example, the
3300
3300
following <command>INSERT</command> statement will fail:
3301
3301
<programlisting>
3302
- INSERT INTO cities (name, population, altitude , state)
3302
+ INSERT INTO cities (name, population, elevation , state)
3303
3303
VALUES ('Albany', NULL, NULL, 'NY');
3304
3304
</programlisting>
3305
3305
We might hope that the data would somehow be routed to the
0 commit comments