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
c282b36d
Commit
c282b36d
authored
Jan 07, 2010
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tablespace.c comment improvements.
parent
85fcbd86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/backend/commands/tablespace.c
src/backend/commands/tablespace.c
+8
-6
No files found.
src/backend/commands/tablespace.c
View file @
c282b36d
...
...
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.
69 2010/01/07 04:05
:39 momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.
70 2010/01/07 04:10
:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -99,9 +99,8 @@ static void write_version_file(const char *path);
* symlink would normally be. This isn't an exact replay of course, but
* it's the best we can do given the available information.
*
* If tablespaces are not supported, you might think this could be a no-op,
* but you'd be wrong: we still need it in case we have to re-create a
* database subdirectory (of $PGDATA/base) during WAL replay.
* If tablespaces are not supported, we still need it in case we have to
* re-create a database subdirectory (of $PGDATA/base) during WAL replay.
*/
void
TablespaceCreateDbspace
(
Oid
spcNode
,
Oid
dbNode
,
bool
isRedo
)
...
...
@@ -123,6 +122,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
if
(
stat
(
dir
,
&
st
)
<
0
)
{
/* Directory does not exist? */
if
(
errno
==
ENOENT
)
{
/*
...
...
@@ -137,7 +137,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
*/
if
(
stat
(
dir
,
&
st
)
==
0
&&
S_ISDIR
(
st
.
st_mode
))
{
/* Directory was created
.
*/
/* Directory was created */
}
else
{
...
...
@@ -152,6 +152,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
(
errcode_for_file_access
(),
errmsg
(
"could not create directory
\"
%s
\"
: %m"
,
dir
)));
/* Parent directory must be missing */
parentdir
=
pstrdup
(
dir
);
get_parent_directory
(
parentdir
);
...
...
@@ -162,6 +163,7 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
errmsg
(
"could not create directory
\"
%s
\"
: %m"
,
parentdir
)));
pfree
(
parentdir
);
/* Create database directory */
if
(
mkdir
(
dir
,
S_IRWXU
)
<
0
)
ereport
(
ERROR
,
...
...
@@ -252,7 +254,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
* '/<dboid>/<relid>.<nnn>' (XXX but do we ever form the whole path
* explicitly? This may be overly conservative.)
*/
if
(
strlen
(
location
)
>=
(
MAXPGPATH
-
1
-
OIDCHARS
-
1
-
OIDCHARS
-
1
-
OIDCHARS
)
)
if
(
strlen
(
location
)
>=
MAXPGPATH
-
1
-
OIDCHARS
-
1
-
OIDCHARS
-
1
-
OIDCHARS
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_OBJECT_DEFINITION
),
errmsg
(
"tablespace location
\"
%s
\"
is too long"
,
...
...
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