summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorFujii Masao2015-05-15 11:09:57 +0000
committerFujii Masao2015-05-15 11:09:57 +0000
commitecd222e770d352121590363ffdf981147a43e976 (patch)
tree9fa6f9d3ad7002f5d8ced9948d49b72206bad713 /src/include
parent4b8f797f672bef07b4e87b4650b4035731b61d84 (diff)
Support VERBOSE option in REINDEX command.
When this option is specified, a progress report is printed as each index is reindexed. Per discussion, we agreed on the following syntax for the extensibility of the options. REINDEX (flexible options) { INDEX | ... } name Sawada Masahiko. Reviewed by Robert Haas, Fabrízio Mello, Alvaro Herrera, Kyotaro Horiguchi, Jim Nasby and me. Discussion: CAD21AoA0pK3YcOZAFzMae+2fcc3oGp5zoRggDyMNg5zoaWDhdQ@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/index.h4
-rw-r--r--src/include/commands/defrem.h7
-rw-r--r--src/include/nodes/parsenodes.h5
3 files changed, 11 insertions, 5 deletions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 06f38202a5f..e961d37172c 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -115,7 +115,7 @@ extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot);
extern void index_set_state_flags(Oid indexId, IndexStateFlagsAction action);
extern void reindex_index(Oid indexId, bool skip_constraint_checks,
- char relpersistence);
+ char relpersistence, int options);
/* Flag bits for reindex_relation(): */
#define REINDEX_REL_PROCESS_TOAST 0x01
@@ -124,7 +124,7 @@ extern void reindex_index(Oid indexId, bool skip_constraint_checks,
#define REINDEX_REL_FORCE_INDEXES_UNLOGGED 0x08
#define REINDEX_REL_FORCE_INDEXES_PERMANENT 0x10
-extern bool reindex_relation(Oid relid, int flags);
+extern bool reindex_relation(Oid relid, int flags, int options);
extern bool ReindexIsProcessingHeap(Oid heapOid);
extern bool ReindexIsProcessingIndex(Oid indexOid);
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h
index c3a1748e00f..d6257250cbe 100644
--- a/src/include/commands/defrem.h
+++ b/src/include/commands/defrem.h
@@ -29,9 +29,10 @@ extern ObjectAddress DefineIndex(Oid relationId,
bool check_rights,
bool skip_build,
bool quiet);
-extern Oid ReindexIndex(RangeVar *indexRelation);
-extern Oid ReindexTable(RangeVar *relation);
-extern void ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind);
+extern Oid ReindexIndex(RangeVar *indexRelation, int options);
+extern Oid ReindexTable(RangeVar *relation, int options);
+extern void ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
+ int options);
extern char *makeObjectName(const char *name1, const char *name2,
const char *label);
extern char *ChooseRelationName(const char *name1, const char *name2,
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 556c1c5d9da..053f1b01213 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -2782,6 +2782,10 @@ typedef struct ConstraintsSetStmt
* REINDEX Statement
* ----------------------
*/
+
+/* Reindex options */
+#define REINDEXOPT_VERBOSE 1 << 0 /* print progress info */
+
typedef enum ReindexObjectType
{
REINDEX_OBJECT_INDEX, /* index */
@@ -2797,6 +2801,7 @@ typedef struct ReindexStmt
ReindexObjectType kind; /* REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE, etc. */
RangeVar *relation; /* Table or index to reindex */
const char *name; /* name of database to reindex */
+ int options; /* Reindex options flags */
} ReindexStmt;
/* ----------------------