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

Tablespaces. Alternate database locations are dead, long live tablespaces.

There are various things left to do: contrib dbsize and oid2name modules
need work, and so does the documentation.  Also someone should think about
COMMENT ON TABLESPACE and maybe RENAME TABLESPACE.  Also initlocation is
dead, it just doesn't know it yet.

Gavin Sherry and Tom Lane.
This commit is contained in:
Tom Lane
2004-06-18 06:14:31 +00:00
parent 474875f443
commit 2467394ee1
94 changed files with 3765 additions and 1588 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.285 2004/06/09 19:08:15 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.286 2004/06/18 06:13:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1753,6 +1753,7 @@ _copyCreateStmt(CreateStmt *from)
COPY_NODE_FIELD(constraints);
COPY_SCALAR_FIELD(hasoids);
COPY_SCALAR_FIELD(oncommit);
COPY_STRING_FIELD(tablespacename);
return newnode;
}
@ -1836,6 +1837,7 @@ _copyIndexStmt(IndexStmt *from)
COPY_STRING_FIELD(idxname);
COPY_NODE_FIELD(relation);
COPY_STRING_FIELD(accessMethod);
COPY_STRING_FIELD(tableSpace);
COPY_NODE_FIELD(indexParams);
COPY_NODE_FIELD(whereClause);
COPY_NODE_FIELD(rangetable);
@ -2146,6 +2148,7 @@ _copyCreateSeqStmt(CreateSeqStmt *from)
COPY_NODE_FIELD(sequence);
COPY_NODE_FIELD(options);
COPY_STRING_FIELD(tablespacename);
return newnode;
}
@ -2193,6 +2196,28 @@ _copyVariableResetStmt(VariableResetStmt *from)
return newnode;
}
static CreateTableSpaceStmt *
_copyCreateTableSpaceStmt(CreateTableSpaceStmt *from)
{
CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt);
COPY_STRING_FIELD(tablespacename);
COPY_STRING_FIELD(owner);
COPY_STRING_FIELD(location);
return newnode;
}
static DropTableSpaceStmt *
_copyDropTableSpaceStmt(DropTableSpaceStmt *from)
{
DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt);
COPY_STRING_FIELD(tablespacename);
return newnode;
}
static CreateTrigStmt *
_copyCreateTrigStmt(CreateTrigStmt *from)
{
@ -2371,6 +2396,7 @@ _copyCreateSchemaStmt(CreateSchemaStmt *from)
COPY_STRING_FIELD(schemaname);
COPY_STRING_FIELD(authid);
COPY_STRING_FIELD(tablespacename);
COPY_NODE_FIELD(schemaElts);
return newnode;
@ -2914,6 +2940,12 @@ copyObject(void *from)
case T_VariableResetStmt:
retval = _copyVariableResetStmt(from);
break;
case T_CreateTableSpaceStmt:
retval = _copyCreateTableSpaceStmt(from);
break;
case T_DropTableSpaceStmt:
retval = _copyDropTableSpaceStmt(from);
break;
case T_CreateTrigStmt:
retval = _copyCreateTrigStmt(from);
break;