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
33cb8ff6
Commit
33cb8ff6
authored
Apr 28, 2015
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn about tablespace creation in PGDATA
Also add warning to pg_upgrade Report by Josh Berkus
parent
290713e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
src/backend/commands/tablespace.c
src/backend/commands/tablespace.c
+6
-0
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/check.c
+4
-0
No files found.
src/backend/commands/tablespace.c
View file @
33cb8ff6
...
...
@@ -288,6 +288,12 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
errmsg
(
"tablespace location
\"
%s
\"
is too long"
,
location
)));
/* Warn if the tablespace is in the data directory. */
if
(
path_is_prefix_of_path
(
DataDir
,
location
))
ereport
(
WARNING
,
(
errcode
(
ERRCODE_INVALID_OBJECT_DEFINITION
),
errmsg
(
"tablespace location should not be inside the data directory"
)));
/*
* Disallow creation of tablespaces named "pg_xxx"; we reserve this
* namespace for system purposes.
...
...
src/bin/pg_upgrade/check.c
View file @
33cb8ff6
...
...
@@ -508,6 +508,10 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
canonicalize_path
(
old_tablespace_dir
);
if
(
path_is_prefix_of_path
(
old_cluster_pgdata
,
old_tablespace_dir
))
{
/* reproduce warning from CREATE TABLESPACE that is in the log */
pg_log
(
PG_WARNING
,
"
\n
WARNING: user-defined tablespace locations should not be inside the data directory, e.g. %s
\n
"
,
old_tablespace_dir
);
/* Unlink file in case it is left over from a previous run. */
unlink
(
*
deletion_script_file_name
);
pg_free
(
*
deletion_script_file_name
);
...
...
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