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
58d4f951
Commit
58d4f951
authored
Aug 17, 2001
by
Hiroshi Inoue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure to hold an exclusive lock while reindexing a relation.
This is mainly to help developers to understand the code.
parent
9df188bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/backend/catalog/index.c
src/backend/catalog/index.c
+11
-3
No files found.
src/backend/catalog/index.c
View file @
58d4f951
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.1
59 2001/08/10 18:57:33 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.1
60 2001/08/17 23:50:00 inoue
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -2016,11 +2016,16 @@ reindex_relation(Oid relid, bool force)
if
(
IsIgnoringSystemIndexes
())
upd_pg_class_inplace
=
true
;
/*
* Ensure to hold an exclusive lock throughout the
* transaction. The lock could be less intensive
* but now it's AccessExclusiveLock for simplicity.
*/
rel
=
heap_open
(
relid
,
AccessExclusiveLock
);
/*
* ignore the indexes of the target system relation while processing
* reindex.
*/
rel
=
RelationIdGetRelation
(
relid
);
if
(
!
IsIgnoringSystemIndexes
()
&&
IsSystemRelationName
(
NameStr
(
rel
->
rd_rel
->
relname
)))
deactivate_needed
=
true
;
#ifndef ENABLE_REINDEX_NAILED_RELATIONS
...
...
@@ -2055,7 +2060,10 @@ reindex_relation(Oid relid, bool force)
else
elog
(
ERROR
,
"the target relation %u is shared"
,
relid
);
}
RelationClose
(
rel
);
/*
* Continue to hold the lock.
*/
heap_close
(
rel
,
NoLock
);
old
=
SetReindexProcessing
(
true
);
if
(
deactivate_needed
)
...
...
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