mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -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;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.224 2004/06/09 19:08:15 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.225 2004/06/18 06:13:28 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -835,6 +835,7 @@ _equalCreateStmt(CreateStmt *a, CreateStmt *b)
|
||||
COMPARE_NODE_FIELD(constraints);
|
||||
COMPARE_SCALAR_FIELD(hasoids);
|
||||
COMPARE_SCALAR_FIELD(oncommit);
|
||||
COMPARE_STRING_FIELD(tablespacename);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -904,6 +905,7 @@ _equalIndexStmt(IndexStmt *a, IndexStmt *b)
|
||||
COMPARE_STRING_FIELD(idxname);
|
||||
COMPARE_NODE_FIELD(relation);
|
||||
COMPARE_STRING_FIELD(accessMethod);
|
||||
COMPARE_STRING_FIELD(tableSpace);
|
||||
COMPARE_NODE_FIELD(indexParams);
|
||||
COMPARE_NODE_FIELD(whereClause);
|
||||
COMPARE_NODE_FIELD(rangetable);
|
||||
@@ -1164,6 +1166,7 @@ _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
|
||||
{
|
||||
COMPARE_NODE_FIELD(sequence);
|
||||
COMPARE_NODE_FIELD(options);
|
||||
COMPARE_STRING_FIELD(tablespacename);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1203,6 +1206,24 @@ _equalVariableResetStmt(VariableResetStmt *a, VariableResetStmt *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
|
||||
{
|
||||
COMPARE_STRING_FIELD(tablespacename);
|
||||
COMPARE_STRING_FIELD(owner);
|
||||
COMPARE_STRING_FIELD(location);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
|
||||
{
|
||||
COMPARE_STRING_FIELD(tablespacename);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
|
||||
{
|
||||
@@ -1352,6 +1373,7 @@ _equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
|
||||
{
|
||||
COMPARE_STRING_FIELD(schemaname);
|
||||
COMPARE_STRING_FIELD(authid);
|
||||
COMPARE_STRING_FIELD(tablespacename);
|
||||
COMPARE_NODE_FIELD(schemaElts);
|
||||
|
||||
return true;
|
||||
@@ -2052,6 +2074,12 @@ equal(void *a, void *b)
|
||||
case T_VariableResetStmt:
|
||||
retval = _equalVariableResetStmt(a, b);
|
||||
break;
|
||||
case T_CreateTableSpaceStmt:
|
||||
retval = _equalCreateTableSpaceStmt(a, b);
|
||||
break;
|
||||
case T_DropTableSpaceStmt:
|
||||
retval = _equalDropTableSpaceStmt(a, b);
|
||||
break;
|
||||
case T_CreateTrigStmt:
|
||||
retval = _equalCreateTrigStmt(a, b);
|
||||
break;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.239 2004/06/09 19:08:15 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.240 2004/06/18 06:13:28 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every node type that can appear in stored rules' parsetrees *must*
|
||||
@@ -1128,7 +1128,7 @@ _outInClauseInfo(StringInfo str, InClauseInfo *node)
|
||||
static void
|
||||
_outCreateStmt(StringInfo str, CreateStmt *node)
|
||||
{
|
||||
WRITE_NODE_TYPE("CREATE");
|
||||
WRITE_NODE_TYPE("CREATESTMT");
|
||||
|
||||
WRITE_NODE_FIELD(relation);
|
||||
WRITE_NODE_FIELD(tableElts);
|
||||
@@ -1136,16 +1136,18 @@ _outCreateStmt(StringInfo str, CreateStmt *node)
|
||||
WRITE_NODE_FIELD(constraints);
|
||||
WRITE_ENUM_FIELD(hasoids, ContainsOids);
|
||||
WRITE_ENUM_FIELD(oncommit, OnCommitAction);
|
||||
WRITE_STRING_FIELD(tablespacename);
|
||||
}
|
||||
|
||||
static void
|
||||
_outIndexStmt(StringInfo str, IndexStmt *node)
|
||||
{
|
||||
WRITE_NODE_TYPE("INDEX");
|
||||
WRITE_NODE_TYPE("INDEXSTMT");
|
||||
|
||||
WRITE_STRING_FIELD(idxname);
|
||||
WRITE_NODE_FIELD(relation);
|
||||
WRITE_STRING_FIELD(accessMethod);
|
||||
WRITE_STRING_FIELD(tableSpace);
|
||||
WRITE_NODE_FIELD(indexParams);
|
||||
WRITE_NODE_FIELD(whereClause);
|
||||
WRITE_NODE_FIELD(rangetable);
|
||||
|
||||
Reference in New Issue
Block a user