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
3633b3f6
Commit
3633b3f6
authored
Jan 04, 2017
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assorted code improvements for table partitioning.
Michael Paquier, per Coverity.
parent
18fc5192
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+4
-0
src/backend/catalog/partition.c
src/backend/catalog/partition.c
+6
-0
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+8
-2
No files found.
src/backend/catalog/heap.c
View file @
3633b3f6
...
...
@@ -3248,6 +3248,10 @@ StorePartitionBound(Relation rel, Relation parent, Node *bound)
classRel
=
heap_open
(
RelationRelationId
,
RowExclusiveLock
);
tuple
=
SearchSysCacheCopy1
(
RELOID
,
ObjectIdGetDatum
(
RelationGetRelid
(
rel
)));
if
(
!
HeapTupleIsValid
(
tuple
))
elog
(
ERROR
,
"cache lookup failed for relation %u"
,
RelationGetRelid
(
rel
));
#ifdef USE_ASSERT_CHECKING
{
Form_pg_class
classForm
;
...
...
src/backend/catalog/partition.c
View file @
3633b3f6
...
...
@@ -200,6 +200,8 @@ RelationBuildPartitionDesc(Relation rel)
Node
*
boundspec
;
tuple
=
SearchSysCache1
(
RELOID
,
inhrelid
);
if
(
!
HeapTupleIsValid
(
tuple
))
elog
(
ERROR
,
"cache lookup failed for relation %u"
,
inhrelid
);
/*
* It is possible that the pg_class tuple of a partition has not been
...
...
@@ -1516,6 +1518,10 @@ generate_partition_qual(Relation rel)
elog
(
ERROR
,
"relation
\"
%s
\"
has relispartition = false"
,
RelationGetRelationName
(
rel
));
tuple
=
SearchSysCache1
(
RELOID
,
RelationGetRelid
(
rel
));
if
(
!
HeapTupleIsValid
(
tuple
))
elog
(
ERROR
,
"cache lookup failed for relation %u"
,
RelationGetRelid
(
rel
));
boundDatum
=
SysCacheGetAttr
(
RELOID
,
tuple
,
Anum_pg_class_relpartbound
,
&
isnull
);
...
...
src/bin/pg_dump/pg_dump.c
View file @
3633b3f6
...
...
@@ -5736,7 +5736,7 @@ getPartitions(Archive *fout, int *numPartitions)
PGresult
*
res
;
int
ntups
;
int
i
;
PQExpBuffer
query
=
createPQExpBuffer
()
;
PQExpBuffer
query
;
PartInfo
*
partinfo
;
int
i_partrelid
;
...
...
@@ -5750,6 +5750,8 @@ getPartitions(Archive *fout, int *numPartitions)
return
NULL
;
}
query
=
createPQExpBuffer
();
/* Make sure we are in proper schema */
selectSourceSchema
(
fout
,
"pg_catalog"
);
...
...
@@ -7067,7 +7069,7 @@ getTransforms(Archive *fout, int *numTransforms)
void
getTablePartitionKeyInfo
(
Archive
*
fout
,
TableInfo
*
tblinfo
,
int
numTables
)
{
PQExpBuffer
q
=
createPQExpBuffer
()
;
PQExpBuffer
q
;
int
i
;
PGresult
*
res
;
...
...
@@ -7075,6 +7077,8 @@ getTablePartitionKeyInfo(Archive *fout, TableInfo *tblinfo, int numTables)
if
(
fout
->
remoteVersion
<
100000
)
return
;
q
=
createPQExpBuffer
();
for
(
i
=
0
;
i
<
numTables
;
i
++
)
{
TableInfo
*
tbinfo
=
&
(
tblinfo
[
i
]);
...
...
@@ -7094,6 +7098,8 @@ getTablePartitionKeyInfo(Archive *fout, TableInfo *tblinfo, int numTables)
Assert
(
PQntuples
(
res
)
==
1
);
tbinfo
->
partkeydef
=
pg_strdup
(
PQgetvalue
(
res
,
0
,
0
));
}
destroyPQExpBuffer
(
q
);
}
/*
...
...
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