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
85fcbd86
Commit
85fcbd86
authored
Jan 07, 2010
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify tablespace.c::TablespaceCreateDbspace() comments.
parent
814c8a03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/backend/commands/tablespace.c
src/backend/commands/tablespace.c
+9
-6
No files found.
src/backend/commands/tablespace.c
View file @
85fcbd86
...
...
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.6
8 2010/01/06 23:23:51
momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.6
9 2010/01/07 04:05:39
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -89,7 +89,7 @@ static void write_version_file(const char *path);
* Each database using a table space is isolated into its own name space
* by a subdirectory named for the database OID. On first creation of an
* object in the tablespace, create the subdirectory. If the subdirectory
* already exists,
just
fall through quietly.
* already exists, fall through quietly.
*
* isRedo indicates that we are creating an object during WAL replay.
* In this case we will cope with the possibility of the tablespace
...
...
@@ -137,29 +137,32 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
*/
if
(
stat
(
dir
,
&
st
)
==
0
&&
S_ISDIR
(
st
.
st_mode
))
{
/*
need not do anything
*/
/*
Directory was created.
*/
}
else
{
/*
OK, go for it
*/
/*
Directory creation failed?
*/
if
(
mkdir
(
dir
,
S_IRWXU
)
<
0
)
{
char
*
parentdir
;
/* Failure other than not exists? */
if
(
errno
!=
ENOENT
||
!
isRedo
)
ereport
(
ERROR
,
(
errcode_for_file_access
(),
errmsg
(
"could not create directory
\"
%s
\"
: %m"
,
dir
)));
/*
Try to make parent directory too
*/
/*
Parent directory must be missing
*/
parentdir
=
pstrdup
(
dir
);
get_parent_directory
(
parentdir
);
/* Can't create parent either? */
if
(
mkdir
(
parentdir
,
S_IRWXU
)
<
0
)
ereport
(
ERROR
,
(
errcode_for_file_access
(),
errmsg
(
"could not create directory
\"
%s
\"
: %m"
,
parentdir
)));
pfree
(
parentdir
);
/* Create database directory */
if
(
mkdir
(
dir
,
S_IRWXU
)
<
0
)
ereport
(
ERROR
,
(
errcode_for_file_access
(),
...
...
@@ -179,7 +182,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
}
else
{
/*
be paranoid
*/
/*
Is it not a directory?
*/
if
(
!
S_ISDIR
(
st
.
st_mode
))
ereport
(
ERROR
,
(
errcode
(
ERRCODE_WRONG_OBJECT_TYPE
),
...
...
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