Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
77fe28f3
Commit
77fe28f3
authored
May 03, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Describe handling of multiply-inherited fields correctly.
parent
f2122d09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
18 deletions
+46
-18
doc/src/sgml/ref/create_table.sgml
doc/src/sgml/ref/create_table.sgml
+46
-18
No files found.
doc/src/sgml/ref/create_table.sgml
View file @
77fe28f3
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.4
1 2001/02/04 12:18:08 petere
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.4
2 2001/05/03 17:50:55 tgl
Exp $
Postgres documentation
-->
...
...
@@ -26,7 +26,7 @@ Postgres documentation
CREATE [ TEMPORARY | TEMP ] TABLE <replaceable class="PARAMETER">table_name</replaceable> (
{ <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">type</replaceable> [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
| <replaceable>table_constraint</replaceable> } [, ... ]
) [ INHERITS ( <replaceable>
inherited
_table</replaceable> [, ... ] ) ]
) [ INHERITS ( <replaceable>
parent
_table</replaceable> [, ... ] ) ]
where <replaceable class="PARAMETER">column_constraint</replaceable> can be:
[ CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> ]
...
...
@@ -99,17 +99,11 @@ and <replaceable class="PARAMETER">table_constraint</replaceable> can be:
</varlistentry>
<varlistentry>
<term><replaceable class="PARAMETER">
inherited
_table</replaceable></term>
<term><replaceable class="PARAMETER">
parent
_table</replaceable></term>
<listitem>
<para>
The optional INHERITS clause specifies a list of table
names from which this table automatically inherits all fields.
If any inherited field name appears more than once,
<productname>Postgres</productname>
reports an error.
<productname>Postgres</productname> automatically allows the created
table to inherit functions on tables above it in the inheritance
hierarchy.
</para>
</listitem>
</varlistentry>
...
...
@@ -258,20 +252,54 @@ ERROR: Relation '<replaceable class="parameter">table</replaceable>' already ex
existing datatype.
</para>
<para>
A table can have no more than 1600 columns (in practice, the
effective limit is lower because of tuple-length constraints).
A table cannot have the same name as a system catalog table.
</para>
</refsect1>
<refsect1 id="R1-SQL-INHERITSCLAUSE-1">
<title id="R1-SQL-INHERITSCLAUSE-1-TITLE">
INHERITS Clause
</title>
<para>
<synopsis>
INHERITS ( <replaceable class="PARAMETER">parent_table</replaceable> [, ... ] )
</synopsis>
</para>
<para>
The optional INHERITS
clause specifies a collection of table names from which this table
automatically inherits all fields. If any inherited field name
appears more than once, Postgres reports an error. Postgres automatically
allows the created table to inherit functions on tables above it in
the inheritance hierarchy. Inheritance of functions is done according
to the conventions of the Common Lisp Object System (CLOS).
clause specifies a list of table names from which the new table
automatically inherits all fields. If the same field name appears in
more than one parent table, Postgres reports an error unless the field
definitions match in each of the parent tables. If there is no
definition conflict, then the duplicate fields are merged to form a single
field of the new table. If the new table's own field list contains a
field name that is also inherited, this declaration must likewise match
the inherited field(s), and the field definitions are merged into one.
</para>
<para>
A table can have no more than 1600 columns (in practice, the
effective limit is lower because of tuple-length constraints).
A table cannot have the same name as a system catalog table.
Inherited and new field declarations of the same name must specify exactly
the same data type to avoid an error. They need not specify identical
constraints --- all constraints provided from any declaration are merged
together and all are applied to the new table. If the new table explicitly
specifies a default value for the field, this default overrides any
defaults from inherited declarations of the field. Otherwise, any parents
that specify default values for the field must all specify the same
default, or an error will be reported.
</para>
<para>
Postgres automatically allows the created table to inherit functions on
tables above it in the inheritance hierarchy; that is, if we create table
<literal>foo</literal> inheriting from <literal>bar</literal>, then
functions that accept the tuple type <literal>bar</literal> can also be
applied to instances of <literal>foo</literal>. (Currently, this works
reliably for functions on the first or only parent table, but not so well
for functions on additional parents.)
</para>
</refsect1>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment