1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/inherit.sgml,v 1.18 2002/01/07 02:29:12 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/inherit.sgml,v 1.19 2002/04/13 17:17:29 tgl Exp $
3
3
-->
4
4
5
5
<chapter id="inherit">
@@ -56,35 +56,28 @@ SELECT name, altitude
56
56
which returns:
57
57
58
58
<programlisting>
59
- +----------+----------+
60
- |name | altitude |
61
- +----------+----------+
62
- |Las Vegas | 2174 |
63
- +----------+----------+
64
- |Mariposa | 1953 |
65
- +----------+----------+
66
- |Madison | 845 |
67
- +----------+----------+
59
+ name | altitude
60
+ -----------+----------
61
+ Las Vegas | 2174
62
+ Mariposa | 1953
63
+ Madison | 845
68
64
</programlisting>
69
65
</para>
70
66
71
67
<para>
72
68
On the other hand, the following query finds
73
69
all the cities that are not state capitals and
74
- are situated at an altitudeof 500ft or higher :
70
+ are situated at an altitudeover 500ft:
75
71
76
72
<programlisting>
77
73
SELECT name, altitude
78
74
FROM ONLY cities
79
75
WHERE altitude > 500;
80
76
81
- +----------+----------+
82
- |name | altitude |
83
- +----------+----------+
84
- |Las Vegas | 2174 |
85
- +----------+----------+
86
- |Mariposa | 1953 |
87
- +----------+----------+
77
+ name | altitude
78
+ -----------+----------
79
+ Las Vegas | 2174
80
+ Mariposa | 1953
88
81
</programlisting>
89
82
</para>
90
83
@@ -112,18 +105,16 @@ SELECT name, altitude
112
105
which returns:
113
106
114
107
<programlisting>
115
- +---------+----------+----------+
116
- |tableoid |name | altitude |
117
- +---------+----------+----------+
118
- |37292 |Las Vegas | 2174 |
119
- +---------+----------+----------+
120
- |37280 |Mariposa | 1953 |
121
- +---------+----------+----------+
122
- |37280 |Madison | 845 |
123
- +---------+----------+----------+
108
+ tableoid | name | altitude
109
+ ----------+-----------+----------
110
+ 139793 | Las Vegas | 2174
111
+ 139793 | Mariposa | 1953
112
+ 139798 | Madison | 845
124
113
</programlisting>
125
114
126
- If you do a join with pg_class you can see the actual table name:
115
+ (If you try to reproduce this example, you will probably get different
116
+ numeric OIDs.) By doing a join with pg_class you can see the actual table
117
+ names:
127
118
128
119
<programlisting>
129
120
SELECT p.relname, c.name, c.altitude
@@ -134,15 +125,11 @@ SELECT name, altitude
134
125
which returns:
135
126
136
127
<programlisting>
137
- +---------+----------+----------+
138
- |relname |name | altitude |
139
- +---------+----------+----------+
140
- |capitals |Las Vegas | 2174 |
141
- +---------+----------+----------+
142
- |cities |Mariposa | 1953 |
143
- +---------+----------+----------+
144
- |cities |Madison | 845 |
145
- +---------+----------+----------+
128
+ relname | name | altitude
129
+ ----------+-----------+----------
130
+ cities | Las Vegas | 2174
131
+ cities | Mariposa | 1953
132
+ capitals | Madison | 845
146
133
</programlisting>
147
134
148
135
</para>