1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Support ALTER TABLESPACE name SET/RESET ( tablespace_options ).

This patch only supports seq_page_cost and random_page_cost as parameters,
but it provides the infrastructure to scalably support many more.
In particular, we may want to add support for effective_io_concurrency,
but I'm leaving that as future work for now.

Thanks to Tom Lane for design help and Alvaro Herrera for the review.
This commit is contained in:
Robert Haas
2010-01-05 21:54:00 +00:00
parent 72559b49c0
commit d86d51a958
28 changed files with 588 additions and 101 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.458 2010/01/02 16:57:45 momjian Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.459 2010/01/05 21:53:58 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@ -3064,6 +3064,18 @@ _copyDropTableSpaceStmt(DropTableSpaceStmt *from)
return newnode;
}
static AlterTableSpaceOptionsStmt *
_copyAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *from)
{
AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt);
COPY_STRING_FIELD(tablespacename);
COPY_NODE_FIELD(options);
COPY_SCALAR_FIELD(isReset);
return newnode;
}
static CreateFdwStmt *
_copyCreateFdwStmt(CreateFdwStmt *from)
{
@ -4028,6 +4040,9 @@ copyObject(void *from)
case T_DropTableSpaceStmt:
retval = _copyDropTableSpaceStmt(from);
break;
case T_AlterTableSpaceOptionsStmt:
retval = _copyAlterTableSpaceOptionsStmt(from);
break;
case T_CreateFdwStmt:
retval = _copyCreateFdwStmt(from);
break;

View File

@ -22,7 +22,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.379 2010/01/02 16:57:46 momjian Exp $
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.380 2010/01/05 21:53:58 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
@ -1568,6 +1568,17 @@ _equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
return true;
}
static bool
_equalAlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *a,
AlterTableSpaceOptionsStmt *b)
{
COMPARE_STRING_FIELD(tablespacename);
COMPARE_NODE_FIELD(options);
COMPARE_SCALAR_FIELD(isReset);
return true;
}
static bool
_equalCreateFdwStmt(CreateFdwStmt *a, CreateFdwStmt *b)
{
@ -2720,6 +2731,9 @@ equal(void *a, void *b)
case T_DropTableSpaceStmt:
retval = _equalDropTableSpaceStmt(a, b);
break;
case T_AlterTableSpaceOptionsStmt:
retval = _equalAlterTableSpaceOptionsStmt(a, b);
break;
case T_CreateFdwStmt:
retval = _equalCreateFdwStmt(a, b);
break;

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.379 2010/01/02 16:57:46 momjian Exp $
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.380 2010/01/05 21:53:58 rhaas Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@ -1590,6 +1590,7 @@ _outRelOptInfo(StringInfo str, RelOptInfo *node)
WRITE_NODE_FIELD(cheapest_total_path);
WRITE_NODE_FIELD(cheapest_unique_path);
WRITE_UINT_FIELD(relid);
WRITE_UINT_FIELD(reltablespace);
WRITE_ENUM_FIELD(rtekind, RTEKind);
WRITE_INT_FIELD(min_attr);
WRITE_INT_FIELD(max_attr);