Skip to content

Commit b0b2168

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 1bb0293 commit b0b2168

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</>,
627-
<structfield>population</>, and <structfield>altitude</>) 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
@@ -2574,7 +2574,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
25742574
CREATE TABLE cities (
25752575
name text,
25762576
population float,
2577-
altitude int -- in feet
2577+
elevation int -- in feet
25782578
);
25792579

25802580
CREATE TABLE capitals (
@@ -2594,40 +2594,40 @@ CREATE TABLE capitals (
25942594
rows of a table or all rows of a table plus all of its descendant tables.
25952595
The latter behavior is the default.
25962596
For example, the following query finds the names of all cities,
2597-
including state capitals, that are located at an altitude over
2597+
including state capitals, that are located at an elevation over
25982598
500 feet:
25992599

26002600
<programlisting>
2601-
SELECT name, altitude
2601+
SELECT name, elevation
26022602
FROM cities
2603-
WHERE altitude &gt; 500;
2603+
WHERE elevation &gt; 500;
26042604
</programlisting>
26052605

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

26092609
<programlisting>
2610-
name | altitude
2611-
-----------+----------
2612-
Las Vegas | 2174
2613-
Mariposa | 1953
2614-
Madison | 845
2610+
name | elevation
2611+
-----------+-----------
2612+
Las Vegas | 2174
2613+
Mariposa | 1953
2614+
Madison | 845
26152615
</programlisting>
26162616
</para>
26172617

26182618
<para>
26192619
On the other hand, the following query finds all the cities that
2620-
are not state capitals and are situated at an altitude over 500 feet:
2620+
are not state capitals and are situated at an elevation over 500 feet:
26212621

26222622
<programlisting>
2623-
SELECT name, altitude
2623+
SELECT name, elevation
26242624
FROM ONLY cities
2625-
WHERE altitude &gt; 500;
2625+
WHERE elevation &gt; 500;
26262626

2627-
name | altitude
2628-
-----------+----------
2629-
Las Vegas | 2174
2630-
Mariposa | 1953
2627+
name | elevation
2628+
-----------+-----------
2629+
Las Vegas | 2174
2630+
Mariposa | 1953
26312631
</programlisting>
26322632
</para>
26332633

@@ -2646,9 +2646,9 @@ SELECT name, altitude
26462646
to explicitly specify that descendant tables are included:
26472647

26482648
<programlisting>
2649-
SELECT name, altitude
2649+
SELECT name, elevation
26502650
FROM cities*
2651-
WHERE altitude &gt; 500;
2651+
WHERE elevation &gt; 500;
26522652
</programlisting>
26532653

26542654
Writing <literal>*</> is not necessary, since this behavior is always
@@ -2663,39 +2663,39 @@ SELECT name, altitude
26632663
originating table:
26642664

26652665
<programlisting>
2666-
SELECT c.tableoid, c.name, c.altitude
2666+
SELECT c.tableoid, c.name, c.elevation
26672667
FROM cities c
2668-
WHERE c.altitude &gt; 500;
2668+
WHERE c.elevation &gt; 500;
26692669
</programlisting>
26702670

26712671
which returns:
26722672

26732673
<programlisting>
2674-
tableoid | name | altitude
2675-
----------+-----------+----------
2676-
139793 | Las Vegas | 2174
2677-
139793 | Mariposa | 1953
2678-
139798 | Madison | 845
2674+
tableoid | name | elevation
2675+
----------+-----------+-----------
2676+
139793 | Las Vegas | 2174
2677+
139793 | Mariposa | 1953
2678+
139798 | Madison | 845
26792679
</programlisting>
26802680

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

26852685
<programlisting>
2686-
SELECT p.relname, c.name, c.altitude
2686+
SELECT p.relname, c.name, c.elevation
26872687
FROM cities c, pg_class p
2688-
WHERE c.altitude &gt; 500 AND c.tableoid = p.oid;
2688+
WHERE c.elevation &gt; 500 AND c.tableoid = p.oid;
26892689
</programlisting>
26902690

26912691
which returns:
26922692

26932693
<programlisting>
2694-
relname | name | altitude
2695-
----------+-----------+----------
2696-
cities | Las Vegas | 2174
2697-
cities | Mariposa | 1953
2698-
capitals | Madison | 845
2694+
relname | name | elevation
2695+
----------+-----------+-----------
2696+
cities | Las Vegas | 2174
2697+
cities | Mariposa | 1953
2698+
capitals | Madison | 845
26992699
</programlisting>
27002700
</para>
27012701

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

27062706
<programlisting>
2707-
SELECT c.tableoid::regclass, c.name, c.altitude
2707+
SELECT c.tableoid::regclass, c.name, c.elevation
27082708
FROM cities c
2709-
WHERE c.altitude &gt; 500;
2709+
WHERE c.elevation &gt; 500;
27102710
</programlisting>
27112711
</para>
27122712

@@ -2716,7 +2716,7 @@ WHERE c.altitude &gt; 500;
27162716
other tables in the inheritance hierarchy. In our example, the
27172717
following <command>INSERT</command> statement will fail:
27182718
<programlisting>
2719-
INSERT INTO cities (name, population, altitude, state)
2719+
INSERT INTO cities (name, population, elevation, state)
27202720
VALUES ('Albany', NULL, NULL, 'NY');
27212721
</programlisting>
27222722
We might hope that the data would somehow be routed to the

0 commit comments

Comments
 (0)