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
3ee80672
Commit
3ee80672
authored
Dec 22, 2016
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review for ATExecAttachPartition.
Amit Langote. Most of this reported by Álvaro Herrera.
parent
c4448683
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+5
-6
No files found.
src/backend/commands/tablecmds.c
View file @
3ee80672
...
...
@@ -12996,7 +12996,6 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd)
*
existConstraint
;
SysScanDesc
scan
;
ScanKeyData
skey
;
HeapTuple
tuple
;
AttrNumber
attno
;
int
natts
;
TupleDesc
tupleDesc
;
...
...
@@ -13018,7 +13017,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd)
errmsg
(
"
\"
%s
\"
is already a partition"
,
RelationGetRelationName
(
attachRel
))));
if
(
attachRel
->
rd_rel
->
reloftype
)
if
(
OidIsValid
(
attachRel
->
rd_rel
->
reloftype
)
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_WRONG_OBJECT_TYPE
),
errmsg
(
"cannot attach a typed table as partition"
)));
...
...
@@ -13119,9 +13118,10 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd)
if
(
attribute
->
attisdropped
)
continue
;
/* Find same column in parent (matching on column name). */
tuple
=
SearchSysCacheCopyAttName
(
RelationGetRelid
(
rel
),
attributeName
);
if
(
!
HeapTupleIsValid
(
tuple
))
/* Try to find the column in parent (matching on column name) */
if
(
!
SearchSysCacheExists2
(
ATTNAME
,
ObjectIdGetDatum
(
RelationGetRelid
(
rel
)),
CStringGetDatum
(
attributeName
)))
ereport
(
ERROR
,
(
errcode
(
ERRCODE_DATATYPE_MISMATCH
),
errmsg
(
"table
\"
%s
\"
contains column
\"
%s
\"
not found in parent
\"
%s
\"
"
,
...
...
@@ -13167,7 +13167,6 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd)
* There is a case in which we cannot rely on just the result of the
* proof.
*/
tupleDesc
=
RelationGetDescr
(
attachRel
);
attachRel_constr
=
tupleDesc
->
constr
;
existConstraint
=
NIL
;
if
(
attachRel_constr
!=
NULL
)
...
...
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