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:
@ -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.
|
||||
|
Reference in New Issue
Block a user