Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit92c12e4

Browse files
committed
docs: land height is "elevation", not "altitude"
Seehttps://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitudeNo patching of regression tests.Reported-by: taf1@cornell.eduDiscussion:https://postgr.es/m/158506544539.679.2278386310645558048@wrigleys.postgresql.orgBackpatch-through: 9.5
1 parent748507c commit92c12e4

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 analtitude
639+
including state capitals, that are located at anelevation
640640
over 500 feet:
641641

642642
<programlisting>
643-
SELECT name,altitude
643+
SELECT name,elevation
644644
FROM cities
645-
WHEREaltitude &gt; 500;
645+
WHEREelevation &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 analtitude over 500 feet:
663+
are situated at anelevation over 500 feet:
664664

665665
<programlisting>
666-
SELECT name,altitude
666+
SELECT name,elevation
667667
FROM ONLY cities
668-
WHEREaltitude &gt; 500;
668+
WHEREelevation &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
@@ -3157,7 +3157,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
31573157
CREATE TABLE cities (
31583158
name text,
31593159
population float,
3160-
altitude int -- in feet
3160+
elevation int -- in feet
31613161
);
31623162

31633163
CREATE TABLE capitals (
@@ -3177,40 +3177,40 @@ CREATE TABLE capitals (
31773177
rows of a table or all rows of a table plus all of its descendant tables.
31783178
The latter behavior is the default.
31793179
For example, the following query finds the names of all cities,
3180-
including state capitals, that are located at analtitude over
3180+
including state capitals, that are located at anelevation over
31813181
500 feet:
31823182

31833183
<programlisting>
3184-
SELECT name,altitude
3184+
SELECT name,elevation
31853185
FROM cities
3186-
WHEREaltitude &gt; 500;
3186+
WHEREelevation &gt; 500;
31873187
</programlisting>
31883188

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

31923192
<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
31983198
</programlisting>
31993199
</para>
32003200

32013201
<para>
32023202
On the other hand, the following query finds all the cities that
3203-
are not state capitals and are situated at analtitude over 500 feet:
3203+
are not state capitals and are situated at anelevation over 500 feet:
32043204

32053205
<programlisting>
3206-
SELECT name,altitude
3206+
SELECT name,elevation
32073207
FROM ONLY cities
3208-
WHEREaltitude &gt; 500;
3208+
WHEREelevation &gt; 500;
32093209

3210-
name |altitude
3211-
-----------+----------
3212-
Las Vegas | 2174
3213-
Mariposa | 1953
3210+
name |elevation
3211+
-----------+-----------
3212+
Las Vegas |2174
3213+
Mariposa |1953
32143214
</programlisting>
32153215
</para>
32163216

@@ -3229,9 +3229,9 @@ SELECT name, altitude
32293229
to explicitly specify that descendant tables are included:
32303230

32313231
<programlisting>
3232-
SELECT name,altitude
3232+
SELECT name,elevation
32333233
FROM cities*
3234-
WHEREaltitude &gt; 500;
3234+
WHEREelevation &gt; 500;
32353235
</programlisting>
32363236

32373237
Writing <literal>*</literal> is not necessary, since this behavior is always
@@ -3246,39 +3246,39 @@ SELECT name, altitude
32463246
originating table:
32473247

32483248
<programlisting>
3249-
SELECT c.tableoid, c.name, c.altitude
3249+
SELECT c.tableoid, c.name, c.elevation
32503250
FROM cities c
3251-
WHERE c.altitude &gt; 500;
3251+
WHERE c.elevation &gt; 500;
32523252
</programlisting>
32533253

32543254
which returns:
32553255

32563256
<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
32623262
</programlisting>
32633263

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

32683268
<programlisting>
3269-
SELECT p.relname, c.name, c.altitude
3269+
SELECT p.relname, c.name, c.elevation
32703270
FROM cities c, pg_class p
3271-
WHERE c.altitude &gt; 500 AND c.tableoid = p.oid;
3271+
WHERE c.elevation &gt; 500 AND c.tableoid = p.oid;
32723272
</programlisting>
32733273

32743274
which returns:
32753275

32763276
<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
32823282
</programlisting>
32833283
</para>
32843284

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

32893289
<programlisting>
3290-
SELECT c.tableoid::regclass, c.name, c.altitude
3290+
SELECT c.tableoid::regclass, c.name, c.elevation
32913291
FROM cities c
3292-
WHERE c.altitude &gt; 500;
3292+
WHERE c.elevation &gt; 500;
32933293
</programlisting>
32943294
</para>
32953295

@@ -3299,7 +3299,7 @@ WHERE c.altitude &gt; 500;
32993299
other tables in the inheritance hierarchy. In our example, the
33003300
following <command>INSERT</command> statement will fail:
33013301
<programlisting>
3302-
INSERT INTO cities (name, population,altitude, state)
3302+
INSERT INTO cities (name, population,elevation, state)
33033303
VALUES ('Albany', NULL, NULL, 'NY');
33043304
</programlisting>
33053305
We might hope that the data would somehow be routed to the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp