1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add ALTER OPERATOR command, for changing selectivity estimator functions.

Other options cannot be changed, as it's not totally clear if cached plans
would need to be invalidated if one of the other options change. Selectivity
estimator functions only change plan costs, not correctness of plans, so
those should be safe.

Original patch by Uriy Zhuravlev, heavily edited by me.
This commit is contained in:
Heikki Linnakangas
2015-07-14 18:17:55 +03:00
parent 705d397cd9
commit 321eed5f0f
13 changed files with 499 additions and 65 deletions

View File

@ -3212,6 +3212,18 @@ _copyAlterOwnerStmt(const AlterOwnerStmt *from)
return newnode;
}
static AlterOperatorStmt *
_copyAlterOperatorStmt(const AlterOperatorStmt *from)
{
AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt);
COPY_NODE_FIELD(opername);
COPY_NODE_FIELD(operargs);
COPY_NODE_FIELD(options);
return newnode;
}
static RuleStmt *
_copyRuleStmt(const RuleStmt *from)
{
@ -4615,6 +4627,9 @@ copyObject(const void *from)
case T_AlterOwnerStmt:
retval = _copyAlterOwnerStmt(from);
break;
case T_AlterOperatorStmt:
retval = _copyAlterOperatorStmt(from);
break;
case T_RuleStmt:
retval = _copyRuleStmt(from);
break;

View File

@ -1338,6 +1338,16 @@ _equalAlterOwnerStmt(const AlterOwnerStmt *a, const AlterOwnerStmt *b)
return true;
}
static bool
_equalAlterOperatorStmt(const AlterOperatorStmt *a, const AlterOperatorStmt *b)
{
COMPARE_NODE_FIELD(opername);
COMPARE_NODE_FIELD(operargs);
COMPARE_NODE_FIELD(options);
return true;
}
static bool
_equalRuleStmt(const RuleStmt *a, const RuleStmt *b)
{
@ -2980,6 +2990,9 @@ equal(const void *a, const void *b)
case T_AlterOwnerStmt:
retval = _equalAlterOwnerStmt(a, b);
break;
case T_AlterOperatorStmt:
retval = _equalAlterOperatorStmt(a, b);
break;
case T_RuleStmt:
retval = _equalRuleStmt(a, b);
break;