summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorMichael Paquier2018-07-24 02:37:32 +0000
committerMichael Paquier2018-07-24 02:37:32 +0000
commit9ebe0572ceab69c57811746ead2d3418daea8673 (patch)
tree965bdf5b17ddc559bb8f39fea8cd51ae48f96d13 /src/backend/parser
parentd9fadbf13103d46c0c6b4b92c62ee13f57524896 (diff)
Refactor cluster_rel() to handle more options
This extends cluster_rel() in such a way that more options can be added in the future, which will reduce the amount of chunk code for an upcoming SKIP_LOCKED aimed for VACUUM. As VACUUM FULL is a different flavor of CLUSTER, we want to make that extensible to ease integration. This only reworks the API and its callers, without providing anything user-facing. Two options are present now: verbose mode and relation recheck when doing the cluster command work across multiple transactions. This could be used as well as a base to extend the grammar of CLUSTER later on. Author: Michael Paquier Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/20180723031058.GE2854@paquier.xyz
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 90dfac2cb1..87f5e95827 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -10478,7 +10478,9 @@ ClusterStmt:
ClusterStmt *n = makeNode(ClusterStmt);
n->relation = $3;
n->indexname = $4;
- n->verbose = $2;
+ n->options = 0;
+ if ($2)
+ n->options |= CLUOPT_VERBOSE;
$$ = (Node*)n;
}
| CLUSTER opt_verbose
@@ -10486,7 +10488,9 @@ ClusterStmt:
ClusterStmt *n = makeNode(ClusterStmt);
n->relation = NULL;
n->indexname = NULL;
- n->verbose = $2;
+ n->options = 0;
+ if ($2)
+ n->options |= CLUOPT_VERBOSE;
$$ = (Node*)n;
}
/* kept for pre-8.3 compatibility */
@@ -10495,7 +10499,9 @@ ClusterStmt:
ClusterStmt *n = makeNode(ClusterStmt);
n->relation = $5;
n->indexname = $3;
- n->verbose = $2;
+ n->options = 0;
+ if ($2)
+ n->options |= CLUOPT_VERBOSE;
$$ = (Node*)n;
}
;