@@ -2574,7 +2574,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
2574
2574
CREATE TABLE cities (
2575
2575
name text,
2576
2576
population float,
2577
- altitude int -- in feet
2577
+ elevation int -- in feet
2578
2578
);
2579
2579
2580
2580
CREATE TABLE capitals (
@@ -2594,40 +2594,40 @@ CREATE TABLE capitals (
2594
2594
rows of a table or all rows of a table plus all of its descendant tables.
2595
2595
The latter behavior is the default.
2596
2596
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
2598
2598
500 feet:
2599
2599
2600
2600
<programlisting>
2601
- SELECT name, altitude
2601
+ SELECT name, elevation
2602
2602
FROM cities
2603
- WHERE altitude > 500;
2603
+ WHERE elevation > 500;
2604
2604
</programlisting>
2605
2605
2606
2606
Given the sample data from the <productname>PostgreSQL</productname>
2607
2607
tutorial (see <xref linkend="tutorial-sql-intro">), this returns:
2608
2608
2609
2609
<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
2615
2615
</programlisting>
2616
2616
</para>
2617
2617
2618
2618
<para>
2619
2619
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:
2621
2621
2622
2622
<programlisting>
2623
- SELECT name, altitude
2623
+ SELECT name, elevation
2624
2624
FROM ONLY cities
2625
- WHERE altitude > 500;
2625
+ WHERE elevation > 500;
2626
2626
2627
- name | altitude
2628
- -----------+----------
2629
- Las Vegas | 2174
2630
- Mariposa | 1953
2627
+ name | elevation
2628
+ -----------+-----------
2629
+ Las Vegas | 2174
2630
+ Mariposa | 1953
2631
2631
</programlisting>
2632
2632
</para>
2633
2633
@@ -2646,9 +2646,9 @@ SELECT name, altitude
2646
2646
to explicitly specify that descendant tables are included:
2647
2647
2648
2648
<programlisting>
2649
- SELECT name, altitude
2649
+ SELECT name, elevation
2650
2650
FROM cities*
2651
- WHERE altitude > 500;
2651
+ WHERE elevation > 500;
2652
2652
</programlisting>
2653
2653
2654
2654
Writing <literal>*</> is not necessary, since this behavior is always
@@ -2663,39 +2663,39 @@ SELECT name, altitude
2663
2663
originating table:
2664
2664
2665
2665
<programlisting>
2666
- SELECT c.tableoid, c.name, c.altitude
2666
+ SELECT c.tableoid, c.name, c.elevation
2667
2667
FROM cities c
2668
- WHERE c.altitude > 500;
2668
+ WHERE c.elevation > 500;
2669
2669
</programlisting>
2670
2670
2671
2671
which returns:
2672
2672
2673
2673
<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
2679
2679
</programlisting>
2680
2680
2681
2681
(If you try to reproduce this example, you will probably get
2682
2682
different numeric OIDs.) By doing a join with
2683
2683
<structname>pg_class</> you can see the actual table names:
2684
2684
2685
2685
<programlisting>
2686
- SELECT p.relname, c.name, c.altitude
2686
+ SELECT p.relname, c.name, c.elevation
2687
2687
FROM cities c, pg_class p
2688
- WHERE c.altitude > 500 AND c.tableoid = p.oid;
2688
+ WHERE c.elevation > 500 AND c.tableoid = p.oid;
2689
2689
</programlisting>
2690
2690
2691
2691
which returns:
2692
2692
2693
2693
<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
2699
2699
</programlisting>
2700
2700
</para>
2701
2701
@@ -2704,9 +2704,9 @@ WHERE c.altitude > 500 AND c.tableoid = p.oid;
2704
2704
alias type, which will print the table OID symbolically:
2705
2705
2706
2706
<programlisting>
2707
- SELECT c.tableoid::regclass, c.name, c.altitude
2707
+ SELECT c.tableoid::regclass, c.name, c.elevation
2708
2708
FROM cities c
2709
- WHERE c.altitude > 500;
2709
+ WHERE c.elevation > 500;
2710
2710
</programlisting>
2711
2711
</para>
2712
2712
@@ -2716,7 +2716,7 @@ WHERE c.altitude > 500;
2716
2716
other tables in the inheritance hierarchy. In our example, the
2717
2717
following <command>INSERT</command> statement will fail:
2718
2718
<programlisting>
2719
- INSERT INTO cities (name, population, altitude , state)
2719
+ INSERT INTO cities (name, population, elevation , state)
2720
2720
VALUES ('Albany', NULL, NULL, 'NY');
2721
2721
</programlisting>
2722
2722
We might hope that the data would somehow be routed to the
0 commit comments