1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Warn about tablespace creation in PGDATA

Also add warning to pg_upgrade

Report by Josh Berkus
This commit is contained in:
Bruce Momjian
2015-04-28 17:35:12 -04:00
parent 290713e31a
commit 33cb8ff6aa
2 changed files with 10 additions and 0 deletions

View File

@ -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.