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
0352e3a7
Commit
0352e3a7
authored
May 22, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Un-break table creation.
parent
a3519a2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
+27
-14
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+27
-14
No files found.
src/backend/catalog/heap.c
View file @
0352e3a7
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.20
2 2002/05/22 07:46:58 inoue
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.20
3 2002/05/22 15:35:43 tgl
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -353,7 +353,7 @@ heap_storage_create(Relation rel)
* --------------------------------
*/
static
void
CheckAttributeNames
(
TupleDesc
tupdesc
,
bool
relhasoids
,
int
relkind
)
CheckAttributeNames
(
TupleDesc
tupdesc
,
bool
relhasoids
,
char
relkind
)
{
int
i
;
int
j
;
...
...
@@ -362,16 +362,25 @@ CheckAttributeNames(TupleDesc tupdesc, bool relhasoids, int relkind)
/*
* first check for collision with system attribute names
*
* also, warn user if attribute to be created has an unknown typid
* (usually as a result of a 'retrieve into' - jolly
* Skip this for a view, since it doesn't have system attributes.
*/
if
(
relkind
!=
RELKIND_VIEW
)
{
for
(
i
=
0
;
i
<
natts
;
i
++
)
{
if
(
SystemAttributeByName
(
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
),
relhasoids
)
!=
NULL
)
elog
(
ERROR
,
"name of column
\"
%s
\"
conflicts with an existing system column"
,
NameStr
(
tupdesc
->
attrs
[
i
]
->
attname
));
}
}
/*
* also, warn user if attribute to be created has an unknown typid
* (usually as a result of a 'retrieve into' - jolly
*/
for
(
i
=
0
;
i
<
natts
;
i
++
)
{
if
(
tupdesc
->
attrs
[
i
]
->
atttypid
==
UNKNOWNOID
)
elog
(
WARNING
,
"Attribute '%s' has an unknown type"
"
\n\t
Proceeding with relation creation anyway"
,
...
...
@@ -404,7 +413,7 @@ static void
AddNewAttributeTuples
(
Oid
new_rel_oid
,
TupleDesc
tupdesc
,
bool
relhasoids
,
int
relkind
)
char
relkind
)
{
Form_pg_attribute
*
dpp
;
int
i
;
...
...
@@ -454,8 +463,9 @@ AddNewAttributeTuples(Oid new_rel_oid,
/*
* next we add the system attributes. Skip OID if rel has no OIDs.
*/
dpp
=
SysAtt
;
if
(
relkind
!=
RELKIND_VIEW
)
{
dpp
=
SysAtt
;
for
(
i
=
0
;
i
<
-
1
-
FirstLowInvalidHeapAttributeNumber
;
i
++
)
{
if
(
relhasoids
||
(
*
dpp
)
->
attnum
!=
ObjectIdAttributeNumber
)
...
...
@@ -484,6 +494,8 @@ AddNewAttributeTuples(Oid new_rel_oid,
heap_freetuple
(
tup
);
}
dpp
++
;
}
}
/*
...
...
@@ -719,7 +731,8 @@ heap_create_with_catalog(const char *relname,
* now add tuples to pg_attribute for the attributes in our new
* relation.
*/
AddNewAttributeTuples
(
new_rel_oid
,
new_rel_desc
->
rd_att
,
relhasoids
,
relkind
);
AddNewAttributeTuples
(
new_rel_oid
,
new_rel_desc
->
rd_att
,
relhasoids
,
relkind
);
/*
* store constraints and defaults passed in the tupdesc, if any.
...
...
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