@ -1681,7 +1681,7 @@ ChooseIndexColumnNames(List *indexElems)
* Recreate a specific index .
*/
Oid
ReindexIndex ( RangeVar * indexRelation )
ReindexIndex ( RangeVar * indexRelation , int options )
{
Oid indOid ;
Oid heapOid = InvalidOid ;
@ -1706,7 +1706,7 @@ ReindexIndex(RangeVar *indexRelation)
persistence = irel - > rd_rel - > relpersistence ;
index_close ( irel , NoLock ) ;
reindex_index ( indOid , false , persistence ) ;
reindex_index ( indOid , false , persistence , options ) ;
return indOid ;
}
@ -1775,7 +1775,7 @@ RangeVarCallbackForReindexIndex(const RangeVar *relation,
* Recreate all indexes of a table ( and of its toast table , if any )
*/
Oid
ReindexTable ( RangeVar * relation )
ReindexTable ( RangeVar * relation , int options )
{
Oid heapOid ;
@ -1785,7 +1785,8 @@ ReindexTable(RangeVar *relation)
if ( ! reindex_relation ( heapOid ,
REINDEX_REL_PROCESS_TOAST |
REINDEX_REL_CHECK_CONSTRAINTS ) )
REINDEX_REL_CHECK_CONSTRAINTS ,
options ) )
ereport ( NOTICE ,
( errmsg ( " table \" %s \" has no indexes " ,
relation - > relname ) ) ) ;
@ -1802,7 +1803,8 @@ ReindexTable(RangeVar *relation)
* That means this must not be called within a user transaction block !
*/
void
ReindexMultipleTables ( const char * objectName , ReindexObjectType objectKind )
ReindexMultipleTables ( const char * objectName , ReindexObjectType objectKind ,
int options )
{
Oid objectOid ;
Relation relationRelation ;
@ -1938,11 +1940,14 @@ ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind)
PushActiveSnapshot ( GetTransactionSnapshot ( ) ) ;
if ( reindex_relation ( relid ,
REINDEX_REL_PROCESS_TOAST |
REINDEX_REL_CHECK_CONSTRAINTS ) )
ereport ( DEBUG1 ,
( errmsg ( " table \" %s.%s \" was reindexed " ,
get_namespace_name ( get_rel_namespace ( relid ) ) ,
get_rel_name ( relid ) ) ) ) ;
REINDEX_REL_CHECK_CONSTRAINTS ,
options ) )
if ( options & REINDEXOPT_VERBOSE )
ereport ( INFO ,
( errmsg ( " table \" %s.%s \" was reindexed " ,
get_namespace_name ( get_rel_namespace ( relid ) ) ,
get_rel_name ( relid ) ) ) ) ;
PopActiveSnapshot ( ) ;
CommitTransactionCommand ( ) ;
}