@@ -2586,7 +2586,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
2586
2586
CREATE TABLE cities (
2587
2587
name text,
2588
2588
population float,
2589
- altitude int -- in feet
2589
+ elevation int -- in feet
2590
2590
);
2591
2591
2592
2592
CREATE TABLE capitals (
@@ -2606,40 +2606,40 @@ CREATE TABLE capitals (
2606
2606
rows of a table or all rows of a table plus all of its descendant tables.
2607
2607
The latter behavior is the default.
2608
2608
For example, the following query finds the names of all cities,
2609
- including state capitals, that are located at an altitude over
2609
+ including state capitals, that are located at an elevation over
2610
2610
500 feet:
2611
2611
2612
2612
<programlisting>
2613
- SELECT name, altitude
2613
+ SELECT name, elevation
2614
2614
FROM cities
2615
- WHERE altitude > 500;
2615
+ WHERE elevation > 500;
2616
2616
</programlisting>
2617
2617
2618
2618
Given the sample data from the <productname>PostgreSQL</productname>
2619
2619
tutorial (see <xref linkend="tutorial-sql-intro"/>), this returns:
2620
2620
2621
2621
<programlisting>
2622
- name | altitude
2623
- -----------+----------
2624
- Las Vegas | 2174
2625
- Mariposa | 1953
2626
- Madison | 845
2622
+ name | elevation
2623
+ -----------+-----------
2624
+ Las Vegas | 2174
2625
+ Mariposa | 1953
2626
+ Madison | 845
2627
2627
</programlisting>
2628
2628
</para>
2629
2629
2630
2630
<para>
2631
2631
On the other hand, the following query finds all the cities that
2632
- are not state capitals and are situated at an altitude over 500 feet:
2632
+ are not state capitals and are situated at an elevation over 500 feet:
2633
2633
2634
2634
<programlisting>
2635
- SELECT name, altitude
2635
+ SELECT name, elevation
2636
2636
FROM ONLY cities
2637
- WHERE altitude > 500;
2637
+ WHERE elevation > 500;
2638
2638
2639
- name | altitude
2640
- -----------+----------
2641
- Las Vegas | 2174
2642
- Mariposa | 1953
2639
+ name | elevation
2640
+ -----------+-----------
2641
+ Las Vegas | 2174
2642
+ Mariposa | 1953
2643
2643
</programlisting>
2644
2644
</para>
2645
2645
@@ -2658,9 +2658,9 @@ SELECT name, altitude
2658
2658
to explicitly specify that descendant tables are included:
2659
2659
2660
2660
<programlisting>
2661
- SELECT name, altitude
2661
+ SELECT name, elevation
2662
2662
FROM cities*
2663
- WHERE altitude > 500;
2663
+ WHERE elevation > 500;
2664
2664
</programlisting>
2665
2665
2666
2666
Writing <literal>*</literal> is not necessary, since this behavior is always
@@ -2675,39 +2675,39 @@ SELECT name, altitude
2675
2675
originating table:
2676
2676
2677
2677
<programlisting>
2678
- SELECT c.tableoid, c.name, c.altitude
2678
+ SELECT c.tableoid, c.name, c.elevation
2679
2679
FROM cities c
2680
- WHERE c.altitude > 500;
2680
+ WHERE c.elevation > 500;
2681
2681
</programlisting>
2682
2682
2683
2683
which returns:
2684
2684
2685
2685
<programlisting>
2686
- tableoid | name | altitude
2687
- ----------+-----------+----------
2688
- 139793 | Las Vegas | 2174
2689
- 139793 | Mariposa | 1953
2690
- 139798 | Madison | 845
2686
+ tableoid | name | elevation
2687
+ ----------+-----------+-----------
2688
+ 139793 | Las Vegas | 2174
2689
+ 139793 | Mariposa | 1953
2690
+ 139798 | Madison | 845
2691
2691
</programlisting>
2692
2692
2693
2693
(If you try to reproduce this example, you will probably get
2694
2694
different numeric OIDs.) By doing a join with
2695
2695
<structname>pg_class</structname> you can see the actual table names:
2696
2696
2697
2697
<programlisting>
2698
- SELECT p.relname, c.name, c.altitude
2698
+ SELECT p.relname, c.name, c.elevation
2699
2699
FROM cities c, pg_class p
2700
- WHERE c.altitude > 500 AND c.tableoid = p.oid;
2700
+ WHERE c.elevation > 500 AND c.tableoid = p.oid;
2701
2701
</programlisting>
2702
2702
2703
2703
which returns:
2704
2704
2705
2705
<programlisting>
2706
- relname | name | altitude
2707
- ----------+-----------+----------
2708
- cities | Las Vegas | 2174
2709
- cities | Mariposa | 1953
2710
- capitals | Madison | 845
2706
+ relname | name | elevation
2707
+ ----------+-----------+-----------
2708
+ cities | Las Vegas | 2174
2709
+ cities | Mariposa | 1953
2710
+ capitals | Madison | 845
2711
2711
</programlisting>
2712
2712
</para>
2713
2713
@@ -2716,9 +2716,9 @@ WHERE c.altitude > 500 AND c.tableoid = p.oid;
2716
2716
alias type, which will print the table OID symbolically:
2717
2717
2718
2718
<programlisting>
2719
- SELECT c.tableoid::regclass, c.name, c.altitude
2719
+ SELECT c.tableoid::regclass, c.name, c.elevation
2720
2720
FROM cities c
2721
- WHERE c.altitude > 500;
2721
+ WHERE c.elevation > 500;
2722
2722
</programlisting>
2723
2723
</para>
2724
2724
@@ -2728,7 +2728,7 @@ WHERE c.altitude > 500;
2728
2728
other tables in the inheritance hierarchy. In our example, the
2729
2729
following <command>INSERT</command> statement will fail:
2730
2730
<programlisting>
2731
- INSERT INTO cities (name, population, altitude , state)
2731
+ INSERT INTO cities (name, population, elevation , state)
2732
2732
VALUES ('Albany', NULL, NULL, 'NY');
2733
2733
</programlisting>
2734
2734
We might hope that the data would somehow be routed to the
0 commit comments