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

Commit291c875

Browse files
committed
Update/correct inheritance examples.
1 parent6f2c0d4 commit291c875

File tree

1 file changed

+24
-37
lines changed

1 file changed

+24
-37
lines changed

‎doc/src/sgml/inherit.sgml

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
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 $
33
-->
44

55
<chapter id="inherit">
@@ -56,35 +56,28 @@ SELECT name, altitude
5656
which returns:
5757

5858
<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
6864
</programlisting>
6965
</para>
7066

7167
<para>
7268
On the other hand, the following query finds
7369
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:
7571

7672
<programlisting>
7773
SELECT name, altitude
7874
FROM ONLY cities
7975
WHERE altitude &gt; 500;
8076

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
8881
</programlisting>
8982
</para>
9083

@@ -112,18 +105,16 @@ SELECT name, altitude
112105
which returns:
113106

114107
<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
124113
</programlisting>
125114

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:
127118

128119
<programlisting>
129120
SELECT p.relname, c.name, c.altitude
@@ -134,15 +125,11 @@ SELECT name, altitude
134125
which returns:
135126

136127
<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
146133
</programlisting>
147134

148135
</para>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp