aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-14 18:17:55 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-14 18:17:55 +0300
commit321eed5f0f7563a0cabb3d7a98132856287c1ad1 (patch)
treeebca2c34b9b89435f1f26a65ce347b830db1e26b /src/backend/nodes/copyfuncs.c
parent705d397cd9cede1fd6fb1260d1689570bf6142d4 (diff)
downloadpostgresql-321eed5f0f7563a0cabb3d7a98132856287c1ad1.tar.gz
postgresql-321eed5f0f7563a0cabb3d7a98132856287c1ad1.zip
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.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 4c363d3d39a..6a08c2db211 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -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;