mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Rename the built-in tablespaces to pg_default and pg_global, and prohibit
creation of user-defined tablespaces with names starting with 'pg_', as per suggestion of Chris K-L. Also install admin-guide tablespace documentation from Gavin.
This commit is contained in:
@ -19,8 +19,8 @@
|
||||
* Thus the full path to an arbitrary file is
|
||||
* $PGDATA/pg_tblspc/spcoid/dboid/relfilenode
|
||||
*
|
||||
* There are two tablespaces created at initdb time: global (for shared
|
||||
* tables) and default (for everything else). For backwards compatibility
|
||||
* There are two tablespaces created at initdb time: pg_global (for shared
|
||||
* tables) and pg_default (for everything else). For backwards compatibility
|
||||
* and to remain functional on platforms without symlinks, these tablespaces
|
||||
* are accessed specially: they are respectively
|
||||
* $PGDATA/global/relfilenode
|
||||
@ -45,7 +45,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.2 2004/06/21 01:04:42 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.3 2004/06/21 04:06:06 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -233,6 +233,17 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
|
||||
errmsg("tablespace location \"%s\" is too long",
|
||||
location)));
|
||||
|
||||
/*
|
||||
* Disallow creation of tablespaces named "pg_xxx"; we reserve this
|
||||
* namespace for system purposes.
|
||||
*/
|
||||
if (!allowSystemTableMods && IsReservedName(stmt->tablespacename))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_RESERVED_NAME),
|
||||
errmsg("unacceptable tablespace name \"%s\"",
|
||||
stmt->tablespacename),
|
||||
errdetail("The prefix \"pg_\" is reserved for system tablespaces.")));
|
||||
|
||||
/*
|
||||
* Check that there is no other tablespace by this name. (The
|
||||
* unique index would catch this anyway, but might as well give
|
||||
|
Reference in New Issue
Block a user