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
c8b4d4d0
Commit
c8b4d4d0
authored
Aug 20, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for index problem that showed up in constraint test.
parent
8ae24a75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
src/backend/catalog/index.c
src/backend/catalog/index.c
+15
-12
No files found.
src/backend/catalog/index.c
View file @
c8b4d4d0
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.5
0 1998/08/20 22:07:3
4 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.5
1 1998/08/20 23:01:2
4 momjian Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -1171,21 +1171,23 @@ index_create(char *heapRelationName,
...
@@ -1171,21 +1171,23 @@ index_create(char *heapRelationName,
void
void
index_destroy
(
Oid
indexId
)
index_destroy
(
Oid
indexId
)
{
{
Relation
userindexRelation
;
Relation
indexRelation
;
Relation
indexRelation
;
Relation
catalog
Relation
;
Relation
relation
Relation
;
Relation
attributeRelation
;
Relation
attributeRelation
;
HeapTuple
tuple
;
HeapTuple
tuple
;
int16
attnum
;
int16
attnum
;
Assert
(
OidIsValid
(
indexId
));
Assert
(
OidIsValid
(
indexId
));
indexRelation
=
index_open
(
indexId
);
/* why open it here? bjm 1998/08/20 */
userindexRelation
=
index_open
(
indexId
);
/* ----------------
/* ----------------
* fix RELATION relation
* fix RELATION relation
* ----------------
* ----------------
*/
*/
catalog
Relation
=
heap_openr
(
RelationRelationName
);
relation
Relation
=
heap_openr
(
RelationRelationName
);
tuple
=
SearchSysCacheTupleCopy
(
RELOID
,
tuple
=
SearchSysCacheTupleCopy
(
RELOID
,
ObjectIdGetDatum
(
indexId
),
ObjectIdGetDatum
(
indexId
),
...
@@ -1193,9 +1195,9 @@ index_destroy(Oid indexId)
...
@@ -1193,9 +1195,9 @@ index_destroy(Oid indexId)
AssertState
(
HeapTupleIsValid
(
tuple
));
AssertState
(
HeapTupleIsValid
(
tuple
));
heap_delete
(
catalog
Relation
,
&
tuple
->
t_ctid
);
heap_delete
(
relation
Relation
,
&
tuple
->
t_ctid
);
pfree
(
tuple
);
pfree
(
tuple
);
heap_close
(
catalog
Relation
);
heap_close
(
relation
Relation
);
/* ----------------
/* ----------------
* fix ATTRIBUTE relation
* fix ATTRIBUTE relation
...
@@ -1226,23 +1228,24 @@ index_destroy(Oid indexId)
...
@@ -1226,23 +1228,24 @@ index_destroy(Oid indexId)
if
(
!
HeapTupleIsValid
(
tuple
))
if
(
!
HeapTupleIsValid
(
tuple
))
elog
(
NOTICE
,
"IndexRelationDestroy: %s's INDEX tuple missing"
,
elog
(
NOTICE
,
"IndexRelationDestroy: %s's INDEX tuple missing"
,
RelationGetRelationName
(
indexRelation
));
RelationGetRelationName
(
user
indexRelation
));
Assert
(
ItemPointerIsValid
(
&
tuple
->
t_ctid
)
);
indexRelation
=
heap_openr
(
IndexRelationName
);
heap_delete
(
indexRelation
,
&
tuple
->
t_ctid
);
heap_delete
(
indexRelation
,
&
tuple
->
t_ctid
);
pfree
(
tuple
);
pfree
(
tuple
);
heap_close
(
indexRelation
);
/*
/*
* flush cache and physically remove the file
* flush cache and physically remove the file
*/
*/
ReleaseRelationBuffers
(
indexRelation
);
ReleaseRelationBuffers
(
user
indexRelation
);
if
(
FileNameUnlink
(
relpath
(
indexRelation
->
rd_rel
->
relname
.
data
))
<
0
)
if
(
FileNameUnlink
(
relpath
(
user
indexRelation
->
rd_rel
->
relname
.
data
))
<
0
)
elog
(
ERROR
,
"amdestroyr: unlink: %m"
);
elog
(
ERROR
,
"amdestroyr: unlink: %m"
);
index_close
(
indexRelation
);
index_close
(
user
indexRelation
);
RelationForgetRelation
(
RelationGetRelid
(
indexRelation
));
RelationForgetRelation
(
RelationGetRelid
(
user
indexRelation
));
}
}
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
...
...
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