Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
291c875f
Commit
291c875f
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Update/correct inheritance examples.
parent
6f2c0d47
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/inherit.sgml
+24
-37
24 additions, 37 deletions
doc/src/sgml/inherit.sgml
with
24 additions
and
37 deletions
doc/src/sgml/inherit.sgml
+
24
−
37
View file @
291c875f
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/inherit.sgml,v 1.1
8
2002/0
1/07 02:29:12 petere
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/inherit.sgml,v 1.1
9
2002/0
4/13 17:17:29 tgl
Exp $
-->
<chapter id="inherit">
...
...
@@ -56,35 +56,28 @@ SELECT name, altitude
which returns:
<programlisting>
+----------+----------+
|name | altitude |
+----------+----------+
|Las Vegas | 2174 |
+----------+----------+
|Mariposa | 1953 |
+----------+----------+
|Madison | 845 |
+----------+----------+
name | altitude
-----------+----------
Las Vegas | 2174
Mariposa | 1953
Madison | 845
</programlisting>
</para>
<para>
On the other hand, the following query finds
all the cities that are not state capitals and
are situated at an altitude o
f
500ft
or higher
:
are situated at an altitude o
ver
500ft:
<programlisting>
SELECT name, altitude
FROM ONLY cities
WHERE altitude > 500;
+----------+----------+
|name | altitude |
+----------+----------+
|Las Vegas | 2174 |
+----------+----------+
|Mariposa | 1953 |
+----------+----------+
name | altitude
-----------+----------
Las Vegas | 2174
Mariposa | 1953
</programlisting>
</para>
...
...
@@ -112,18 +105,16 @@ SELECT name, altitude
which returns:
<programlisting>
+---------+----------+----------+
|tableoid |name | altitude |
+---------+----------+----------+
|37292 |Las Vegas | 2174 |
+---------+----------+----------+
|37280 |Mariposa | 1953 |
+---------+----------+----------+
|37280 |Madison | 845 |
+---------+----------+----------+
tableoid | name | altitude
----------+-----------+----------
139793 | Las Vegas | 2174
139793 | Mariposa | 1953
139798 | Madison | 845
</programlisting>
If you do a join with pg_class you can see the actual table name:
(If you try to reproduce this example, you will probably get different
numeric OIDs.) By doing a join with pg_class you can see the actual table
names:
<programlisting>
SELECT p.relname, c.name, c.altitude
...
...
@@ -134,15 +125,11 @@ SELECT name, altitude
which returns:
<programlisting>
+---------+----------+----------+
|relname |name | altitude |
+---------+----------+----------+
|capitals |Las Vegas | 2174 |
+---------+----------+----------+
|cities |Mariposa | 1953 |
+---------+----------+----------+
|cities |Madison | 845 |
+---------+----------+----------+
relname | name | altitude
----------+-----------+----------
cities | Las Vegas | 2174
cities | Mariposa | 1953
capitals | Madison | 845
</programlisting>
</para>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment