Skip to content

Commit b3cbbd0

Browse files
committed
docs: land height is "elevation", not "altitude"
See https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude No patching of regression tests. Reported-by: taf1@cornell.edu Discussion: https://postgr.es/m/158506544539.679.2278386310645558048@wrigleys.postgresql.org Backpatch-through: 9.5
1 parent e1c0872 commit b3cbbd0

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

doc/src/sgml/advanced.sgml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -585,20 +585,20 @@ SELECT sum(salary) OVER w, avg(salary) OVER w
585585
CREATE TABLE capitals (
586586
name text,
587587
population real,
588-
altitude int, -- (in ft)
588+
elevation int, -- (in ft)
589589
state char(2)
590590
);
591591

592592
CREATE TABLE non_capitals (
593593
name text,
594594
population real,
595-
altitude int -- (in ft)
595+
elevation int -- (in ft)
596596
);
597597

598598
CREATE VIEW cities AS
599-
SELECT name, population, altitude FROM capitals
599+
SELECT name, population, elevation FROM capitals
600600
UNION
601-
SELECT name, population, altitude FROM non_capitals;
601+
SELECT name, population, elevation FROM non_capitals;
602602
</programlisting>
603603

604604
This works OK as far as querying goes, but it gets ugly when you
@@ -612,7 +612,7 @@ CREATE VIEW cities AS
612612
CREATE TABLE cities (
613613
name text,
614614
population real,
615-
altitude int -- (in ft)
615+
elevation int -- (in ft)
616616
);
617617

618618
CREATE TABLE capitals (
@@ -624,7 +624,7 @@ CREATE TABLE capitals (
624624
<para>
625625
In this case, a row of <classname>capitals</classname>
626626
<firstterm>inherits</firstterm> all columns (<structfield>name</structfield>,
627-
<structfield>population</structfield>, and <structfield>altitude</structfield>) from its
627+
<structfield>population</structfield>, and <structfield>elevation</structfield>) from its
628628
<firstterm>parent</firstterm>, <classname>cities</classname>. The
629629
type of the column <structfield>name</structfield> is
630630
<type>text</type>, a native <productname>PostgreSQL</productname>
@@ -636,43 +636,43 @@ CREATE TABLE capitals (
636636

637637
<para>
638638
For example, the following query finds the names of all cities,
639-
including state capitals, that are located at an altitude
639+
including state capitals, that are located at an elevation
640640
over 500 feet:
641641

642642
<programlisting>
643-
SELECT name, altitude
643+
SELECT name, elevation
644644
FROM cities
645-
WHERE altitude &gt; 500;
645+
WHERE elevation &gt; 500;
646646
</programlisting>
647647

648648
which returns:
649649

650650
<screen>
651-
name | altitude
652-
-----------+----------
653-
Las Vegas | 2174
654-
Mariposa | 1953
655-
Madison | 845
651+
name | elevation
652+
-----------+-----------
653+
Las Vegas | 2174
654+
Mariposa | 1953
655+
Madison | 845
656656
(3 rows)
657657
</screen>
658658
</para>
659659

660660
<para>
661661
On the other hand, the following query finds
662662
all the cities that are not state capitals and
663-
are situated at an altitude over 500 feet:
663+
are situated at an elevation over 500 feet:
664664

665665
<programlisting>
666-
SELECT name, altitude
666+
SELECT name, elevation
667667
FROM ONLY cities
668-
WHERE altitude &gt; 500;
668+
WHERE elevation &gt; 500;
669669
</programlisting>
670670

671671
<screen>
672-
name | altitude
673-
-----------+----------
674-
Las Vegas | 2174
675-
Mariposa | 1953
672+
name | elevation
673+
-----------+-----------
674+
Las Vegas | 2174
675+
Mariposa | 1953
676676
(2 rows)
677677
</screen>
678678
</para>

doc/src/sgml/ddl.sgml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
31503150
CREATE TABLE cities (
31513151
name text,
31523152
population float,
3153-
altitude int -- in feet
3153+
elevation int -- in feet
31543154
);
31553155

31563156
CREATE TABLE capitals (
@@ -3170,40 +3170,40 @@ CREATE TABLE capitals (
31703170
rows of a table or all rows of a table plus all of its descendant tables.
31713171
The latter behavior is the default.
31723172
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
31743174
500 feet:
31753175

31763176
<programlisting>
3177-
SELECT name, altitude
3177+
SELECT name, elevation
31783178
FROM cities
3179-
WHERE altitude &gt; 500;
3179+
WHERE elevation &gt; 500;
31803180
</programlisting>
31813181

31823182
Given the sample data from the <productname>PostgreSQL</productname>
31833183
tutorial (see <xref linkend="tutorial-sql-intro"/>), this returns:
31843184

31853185
<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
31913191
</programlisting>
31923192
</para>
31933193

31943194
<para>
31953195
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:
31973197

31983198
<programlisting>
3199-
SELECT name, altitude
3199+
SELECT name, elevation
32003200
FROM ONLY cities
3201-
WHERE altitude &gt; 500;
3201+
WHERE elevation &gt; 500;
32023202

3203-
name | altitude
3204-
-----------+----------
3205-
Las Vegas | 2174
3206-
Mariposa | 1953
3203+
name | elevation
3204+
-----------+-----------
3205+
Las Vegas | 2174
3206+
Mariposa | 1953
32073207
</programlisting>
32083208
</para>
32093209

@@ -3222,9 +3222,9 @@ SELECT name, altitude
32223222
to explicitly specify that descendant tables are included:
32233223

32243224
<programlisting>
3225-
SELECT name, altitude
3225+
SELECT name, elevation
32263226
FROM cities*
3227-
WHERE altitude &gt; 500;
3227+
WHERE elevation &gt; 500;
32283228
</programlisting>
32293229

32303230
Writing <literal>*</literal> is not necessary, since this behavior is always
@@ -3239,39 +3239,39 @@ SELECT name, altitude
32393239
originating table:
32403240

32413241
<programlisting>
3242-
SELECT c.tableoid, c.name, c.altitude
3242+
SELECT c.tableoid, c.name, c.elevation
32433243
FROM cities c
3244-
WHERE c.altitude &gt; 500;
3244+
WHERE c.elevation &gt; 500;
32453245
</programlisting>
32463246

32473247
which returns:
32483248

32493249
<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
32553255
</programlisting>
32563256

32573257
(If you try to reproduce this example, you will probably get
32583258
different numeric OIDs.) By doing a join with
32593259
<structname>pg_class</structname> you can see the actual table names:
32603260

32613261
<programlisting>
3262-
SELECT p.relname, c.name, c.altitude
3262+
SELECT p.relname, c.name, c.elevation
32633263
FROM cities c, pg_class p
3264-
WHERE c.altitude &gt; 500 AND c.tableoid = p.oid;
3264+
WHERE c.elevation &gt; 500 AND c.tableoid = p.oid;
32653265
</programlisting>
32663266

32673267
which returns:
32683268

32693269
<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
32753275
</programlisting>
32763276
</para>
32773277

@@ -3280,9 +3280,9 @@ WHERE c.altitude &gt; 500 AND c.tableoid = p.oid;
32803280
alias type, which will print the table OID symbolically:
32813281

32823282
<programlisting>
3283-
SELECT c.tableoid::regclass, c.name, c.altitude
3283+
SELECT c.tableoid::regclass, c.name, c.elevation
32843284
FROM cities c
3285-
WHERE c.altitude &gt; 500;
3285+
WHERE c.elevation &gt; 500;
32863286
</programlisting>
32873287
</para>
32883288

@@ -3292,7 +3292,7 @@ WHERE c.altitude &gt; 500;
32923292
other tables in the inheritance hierarchy. In our example, the
32933293
following <command>INSERT</command> statement will fail:
32943294
<programlisting>
3295-
INSERT INTO cities (name, population, altitude, state)
3295+
INSERT INTO cities (name, population, elevation, state)
32963296
VALUES ('Albany', NULL, NULL, 'NY');
32973297
</programlisting>
32983298
We might hope that the data would somehow be routed to the

0 commit comments

Comments
 (0)