mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user