Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Add const decorations
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 23 Aug 2023 04:14:11 +0000 (06:14 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 23 Aug 2023 04:39:39 +0000 (06:39 +0200)
in index.c and indexcmds.c and some adjacent places.  This especially
makes it easier to understand for some complicated function signatures
which are the input and the output arguments.

Discussion: https://www.postgresql.org/message-id/flat/5ed89c69-f4e6-5dab-4003-63bde7460e5e%40eisentraut.org

src/backend/bootstrap/bootstrap.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/namespace.c
src/backend/commands/indexcmds.c
src/include/bootstrap/bootstrap.h
src/include/catalog/heap.h
src/include/catalog/index.h
src/include/catalog/namespace.h
src/include/commands/defrem.h

index 49e956b2c577f240dcb2718f8165b4d8755d97f7..4cc2efa95c4815dd190e473b40ee001ae9997414 100644 (file)
@@ -914,7 +914,7 @@ AllocateAttribute(void)
 void
 index_register(Oid heap,
               Oid ind,
-              IndexInfo *indexInfo)
+              const IndexInfo *indexInfo)
 {
    IndexList  *newind;
    MemoryContext oldcxt;
index 96d5885d863420b61f444be4991fa4d015fadc42..70bc4c000682a825c67a739b9070dbebe977dca6 100644 (file)
@@ -697,7 +697,7 @@ void
 InsertPgAttributeTuples(Relation pg_attribute_rel,
                        TupleDesc tupdesc,
                        Oid new_rel_oid,
-                       Datum *attoptions,
+                       const Datum *attoptions,
                        CatalogIndexState indstate)
 {
    TupleTableSlot **slot;
index eb2b8d84c334a6d8e6244e4b08f90a8414fa81ff..2a30eb3a32aebf5bf7e482b91035bcafdec8e353 100644 (file)
@@ -106,20 +106,20 @@ typedef struct
 /* non-export function prototypes */
 static bool relationHasPrimaryKey(Relation rel);
 static TupleDesc ConstructTupleDescriptor(Relation heapRelation,
-                                         IndexInfo *indexInfo,
-                                         List *indexColNames,
+                                         const IndexInfo *indexInfo,
+                                         const List *indexColNames,
                                          Oid accessMethodObjectId,
-                                         Oid *collationObjectId,
-                                         Oid *classObjectId);
+                                         const Oid *collationObjectId,
+                                         const Oid *classObjectId);
 static void InitializeAttributeOids(Relation indexRelation,
                                    int numatts, Oid indexoid);
-static void AppendAttributeTuples(Relation indexRelation, Datum *attopts);
+static void AppendAttributeTuples(Relation indexRelation, const Datum *attopts);
 static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
                                Oid parentIndexId,
-                               IndexInfo *indexInfo,
-                               Oid *collationOids,
-                               Oid *classOids,
-                               int16 *coloptions,
+                               const IndexInfo *indexInfo,
+                               const Oid *collationOids,
+                               const Oid *classOids,
+                               const int16 *coloptions,
                                bool primary,
                                bool isexclusion,
                                bool immediate,
@@ -205,9 +205,9 @@ relationHasPrimaryKey(Relation rel)
  */
 void
 index_check_primary_key(Relation heapRel,
-                       IndexInfo *indexInfo,
+                       const IndexInfo *indexInfo,
                        bool is_alter_table,
-                       IndexStmt *stmt)
+                       const IndexStmt *stmt)
 {
    int         i;
 
@@ -284,11 +284,11 @@ index_check_primary_key(Relation heapRel,
  */
 static TupleDesc
 ConstructTupleDescriptor(Relation heapRelation,
-                        IndexInfo *indexInfo,
-                        List *indexColNames,
+                        const IndexInfo *indexInfo,
+                        const List *indexColNames,
                         Oid accessMethodObjectId,
-                        Oid *collationObjectId,
-                        Oid *classObjectId)
+                        const Oid *collationObjectId,
+                        const Oid *classObjectId)
 {
    int         numatts = indexInfo->ii_NumIndexAttrs;
    int         numkeyatts = indexInfo->ii_NumIndexKeyAttrs;
@@ -516,7 +516,7 @@ InitializeAttributeOids(Relation indexRelation,
  * ----------------------------------------------------------------
  */
 static void
-AppendAttributeTuples(Relation indexRelation, Datum *attopts)
+AppendAttributeTuples(Relation indexRelation, const Datum *attopts)
 {
    Relation    pg_attribute;
    CatalogIndexState indstate;
@@ -551,10 +551,10 @@ static void
 UpdateIndexRelation(Oid indexoid,
                    Oid heapoid,
                    Oid parentIndexId,
-                   IndexInfo *indexInfo,
-                   Oid *collationOids,
-                   Oid *classOids,
-                   int16 *coloptions,
+                   const IndexInfo *indexInfo,
+                   const Oid *collationOids,
+                   const Oid *classOids,
+                   const int16 *coloptions,
                    bool primary,
                    bool isexclusion,
                    bool immediate,
@@ -718,12 +718,12 @@ index_create(Relation heapRelation,
             Oid parentConstraintId,
             RelFileNumber relFileNumber,
             IndexInfo *indexInfo,
-            List *indexColNames,
+            const List *indexColNames,
             Oid accessMethodObjectId,
             Oid tableSpaceId,
-            Oid *collationObjectId,
-            Oid *classObjectId,
-            int16 *coloptions,
+            const Oid *collationObjectId,
+            const Oid *classObjectId,
+            const int16 *coloptions,
             Datum reloptions,
             bits16 flags,
             bits16 constr_flags,
@@ -1908,7 +1908,7 @@ ObjectAddress
 index_constraint_create(Relation heapRelation,
                        Oid indexRelationId,
                        Oid parentConstraintId,
-                       IndexInfo *indexInfo,
+                       const IndexInfo *indexInfo,
                        const char *constraintName,
                        char constraintType,
                        bits16 constr_flags,
@@ -2537,10 +2537,10 @@ BuildDummyIndexInfo(Relation index)
  * Use build_attrmap_by_name(index2, index1) to build the attmap.
  */
 bool
-CompareIndexInfo(IndexInfo *info1, IndexInfo *info2,
-                Oid *collations1, Oid *collations2,
-                Oid *opfamilies1, Oid *opfamilies2,
-                AttrMap *attmap)
+CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2,
+                const Oid *collations1, const Oid *collations2,
+                const Oid *opfamilies1, const Oid *opfamilies2,
+                const AttrMap *attmap)
 {
    int         i;
 
@@ -3559,7 +3559,7 @@ IndexGetRelation(Oid indexId, bool missing_ok)
  */
 void
 reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
-             ReindexParams *params)
+             const ReindexParams *params)
 {
    Relation    iRel,
                heapRelation;
@@ -3872,7 +3872,7 @@ reindex_index(Oid indexId, bool skip_constraint_checks, char persistence,
  * index rebuild.
  */
 bool
-reindex_relation(Oid relid, int flags, ReindexParams *params)
+reindex_relation(Oid relid, int flags, const ReindexParams *params)
 {
    Relation    rel;
    Oid         toast_relid;
@@ -4177,9 +4177,9 @@ SerializeReindexState(Size maxsize, char *start_address)
  *     Restore reindex state in a parallel worker.
  */
 void
-RestoreReindexState(void *reindexstate)
+RestoreReindexState(const void *reindexstate)
 {
-   SerializedReindexState *sistate = (SerializedReindexState *) reindexstate;
+   const SerializedReindexState *sistate = (const SerializedReindexState *) reindexstate;
    int         c = 0;
    MemoryContext oldcontext;
 
index 0c679fbf9444d87d967237ef643349181f09e814..4ceae038ec555e343911205bbc2d79e8812d494c 100644 (file)
@@ -2831,7 +2831,7 @@ TSConfigIsVisible(Oid cfgid)
  * *nspname_p is set to NULL if there is no explicit schema name.
  */
 void
-DeconstructQualifiedName(List *names,
+DeconstructQualifiedName(const List *names,
                         char **nspname_p,
                         char **objname_p)
 {
@@ -3017,7 +3017,7 @@ CheckSetNamespace(Oid oldNspOid, Oid nspOid)
  * if we have to create or clean out the temp namespace.
  */
 Oid
-QualifiedNameGetCreationNamespace(List *names, char **objname_p)
+QualifiedNameGetCreationNamespace(const List *names, char **objname_p)
 {
    char       *schemaname;
    Oid         namespaceId;
@@ -3084,7 +3084,7 @@ get_namespace_oid(const char *nspname, bool missing_ok)
  *     Utility routine to convert a qualified-name list into RangeVar form.
  */
 RangeVar *
-makeRangeVarFromNameList(List *names)
+makeRangeVarFromNameList(const List *names)
 {
    RangeVar   *rel = makeRangeVar(NULL, NULL, -1);
 
@@ -3124,7 +3124,7 @@ makeRangeVarFromNameList(List *names)
  * but we also allow A_Star for the convenience of ColumnRef processing.
  */
 char *
-NameListToString(List *names)
+NameListToString(const List *names)
 {
    StringInfoData string;
    ListCell   *l;
@@ -3158,7 +3158,7 @@ NameListToString(List *names)
  * so the string could be re-parsed (eg, by textToQualifiedNameList).
  */
 char *
-NameListToQuotedString(List *names)
+NameListToQuotedString(const List *names)
 {
    StringInfoData string;
    ListCell   *l;
index baf3e6e57a53c65b2f24a468b9005558dd85ee2e..8e707d4ad910b3cc45c4d1b567efcd1d6081d9f5 100644 (file)
 
 
 /* non-export function prototypes */
-static bool CompareOpclassOptions(Datum *opts1, Datum *opts2, int natts);
+static bool CompareOpclassOptions(const Datum *opts1, const Datum *opts2, int natts);
 static void CheckPredicate(Expr *predicate);
 static void ComputeIndexAttrs(IndexInfo *indexInfo,
                              Oid *typeOidP,
                              Oid *collationOidP,
                              Oid *classOidP,
                              int16 *colOptionP,
-                             List *attList,
-                             List *exclusionOpNames,
+                             const List *attList,
+                             const List *exclusionOpNames,
                              Oid relId,
                              const char *accessMethodName, Oid accessMethodId,
                              bool amcanorder,
@@ -88,25 +88,25 @@ static void ComputeIndexAttrs(IndexInfo *indexInfo,
                              int ddl_sec_context,
                              int *ddl_save_nestlevel);
 static char *ChooseIndexName(const char *tabname, Oid namespaceId,
-                            List *colnames, List *exclusionOpNames,
+                            const List *colnames, const List *exclusionOpNames,
                             bool primary, bool isconstraint);
-static char *ChooseIndexNameAddition(List *colnames);
-static List *ChooseIndexColumnNames(List *indexElems);
-static void ReindexIndex(RangeVar *indexRelation, ReindexParams *params,
+static char *ChooseIndexNameAddition(const List *colnames);
+static List *ChooseIndexColumnNames(const List *indexElems);
+static void ReindexIndex(const RangeVar *indexRelation, const ReindexParams *params,
                         bool isTopLevel);
 static void RangeVarCallbackForReindexIndex(const RangeVar *relation,
                                            Oid relId, Oid oldRelId, void *arg);
-static Oid ReindexTable(RangeVar *relation, ReindexParams *params,
+static Oid ReindexTable(const RangeVar *relation, const ReindexParams *params,
                         bool isTopLevel);
 static void ReindexMultipleTables(const char *objectName,
-                                 ReindexObjectType objectKind, ReindexParams *params);
+                                 ReindexObjectType objectKind, const ReindexParams *params);
 static void reindex_error_callback(void *arg);
-static void ReindexPartitions(Oid relid, ReindexParams *params,
+static void ReindexPartitions(Oid relid, const ReindexParams *params,
                              bool isTopLevel);
-static void ReindexMultipleInternal(List *relids,
-                                   ReindexParams *params);
+static void ReindexMultipleInternal(const List *relids,
+                                   const ReindexParams *params);
 static bool ReindexRelationConcurrently(Oid relationOid,
-                                       ReindexParams *params);
+                                       const ReindexParams *params);
 static void update_relispartition(Oid relationId, bool newval);
 static inline void set_indexsafe_procflags(void);
 
@@ -169,8 +169,8 @@ typedef struct ReindexErrorInfo
 bool
 CheckIndexCompatible(Oid oldId,
                     const char *accessMethodName,
-                    List *attributeList,
-                    List *exclusionOpNames)
+                    const List *attributeList,
+                    const List *exclusionOpNames)
 {
    bool        isconstraint;
    Oid        *typeObjectId;
@@ -349,7 +349,7 @@ CheckIndexCompatible(Oid oldId,
  * datums.  Both elements of arrays and array themselves can be NULL.
  */
 static bool
-CompareOpclassOptions(Datum *opts1, Datum *opts2, int natts)
+CompareOpclassOptions(const Datum *opts1, const Datum *opts2, int natts)
 {
    int         i;
 
@@ -1859,8 +1859,8 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
                  Oid *collationOidP,
                  Oid *classOidP,
                  int16 *colOptionP,
-                 List *attList,    /* list of IndexElem's */
-                 List *exclusionOpNames,
+                 const List *attList,  /* list of IndexElem's */
+                 const List *exclusionOpNames,
                  Oid relId,
                  const char *accessMethodName,
                  Oid accessMethodId,
@@ -2225,7 +2225,7 @@ ComputeIndexAttrs(IndexInfo *indexInfo,
  * partition key definitions.
  */
 Oid
-ResolveOpClass(List *opclass, Oid attrType,
+ResolveOpClass(const List *opclass, Oid attrType,
               const char *accessMethodName, Oid accessMethodId)
 {
    char       *schemaname;
@@ -2542,7 +2542,7 @@ ChooseRelationName(const char *name1, const char *name2,
  */
 static char *
 ChooseIndexName(const char *tabname, Oid namespaceId,
-               List *colnames, List *exclusionOpNames,
+               const List *colnames, const List *exclusionOpNames,
                bool primary, bool isconstraint)
 {
    char       *indexname;
@@ -2596,7 +2596,7 @@ ChooseIndexName(const char *tabname, Oid namespaceId,
  * ChooseExtendedStatisticNameAddition.
  */
 static char *
-ChooseIndexNameAddition(List *colnames)
+ChooseIndexNameAddition(const List *colnames)
 {
    char        buf[NAMEDATALEN * 2];
    int         buflen = 0;
@@ -2630,7 +2630,7 @@ ChooseIndexNameAddition(List *colnames)
  * Returns a List of plain strings (char *, not String nodes).
  */
 static List *
-ChooseIndexColumnNames(List *indexElems)
+ChooseIndexColumnNames(const List *indexElems)
 {
    List       *result = NIL;
    ListCell   *lc;
@@ -2691,7 +2691,7 @@ ChooseIndexColumnNames(List *indexElems)
  * each subroutine of REINDEX.
  */
 void
-ExecReindex(ParseState *pstate, ReindexStmt *stmt, bool isTopLevel)
+ExecReindex(ParseState *pstate, const ReindexStmt *stmt, bool isTopLevel)
 {
    ReindexParams params = {0};
    ListCell   *lc;
@@ -2786,7 +2786,7 @@ ExecReindex(ParseState *pstate, ReindexStmt *stmt, bool isTopLevel)
  *     Recreate a specific index.
  */
 static void
-ReindexIndex(RangeVar *indexRelation, ReindexParams *params, bool isTopLevel)
+ReindexIndex(const RangeVar *indexRelation, const ReindexParams *params, bool isTopLevel)
 {
    struct ReindexIndexCallbackState state;
    Oid         indOid;
@@ -2909,7 +2909,7 @@ RangeVarCallbackForReindexIndex(const RangeVar *relation,
  *     Recreate all indexes of a table (and of its toast table, if any)
  */
 static Oid
-ReindexTable(RangeVar *relation, ReindexParams *params, bool isTopLevel)
+ReindexTable(const RangeVar *relation, const ReindexParams *params, bool isTopLevel)
 {
    Oid         heapOid;
    bool        result;
@@ -2968,7 +2968,7 @@ ReindexTable(RangeVar *relation, ReindexParams *params, bool isTopLevel)
  */
 static void
 ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind,
-                     ReindexParams *params)
+                     const ReindexParams *params)
 {
    Oid         objectOid;
    Relation    relationRelation;
@@ -3206,7 +3206,7 @@ reindex_error_callback(void *arg)
  * by the caller.
  */
 static void
-ReindexPartitions(Oid relid, ReindexParams *params, bool isTopLevel)
+ReindexPartitions(Oid relid, const ReindexParams *params, bool isTopLevel)
 {
    List       *partitions = NIL;
    char        relkind = get_rel_relkind(relid);
@@ -3300,7 +3300,7 @@ ReindexPartitions(Oid relid, ReindexParams *params, bool isTopLevel)
  * and starts a new transaction when finished.
  */
 static void
-ReindexMultipleInternal(List *relids, ReindexParams *params)
+ReindexMultipleInternal(const List *relids, const ReindexParams *params)
 {
    ListCell   *l;
 
@@ -3424,7 +3424,7 @@ ReindexMultipleInternal(List *relids, ReindexParams *params)
  * anyway, and a non-concurrent reindex is more efficient.
  */
 static bool
-ReindexRelationConcurrently(Oid relationOid, ReindexParams *params)
+ReindexRelationConcurrently(Oid relationOid, const ReindexParams *params)
 {
    typedef struct ReindexIndexInfo
    {
index 2c28a52ce71fb6513330a3b4bfe9e2576e0704ee..e1cb73c5f2e46f6a9ce350717da115cac96fed9f 100644 (file)
@@ -42,7 +42,7 @@ extern void InsertOneTuple(void);
 extern void InsertOneValue(char *value, int i);
 extern void InsertOneNull(int i);
 
-extern void index_register(Oid heap, Oid ind, IndexInfo *indexInfo);
+extern void index_register(Oid heap, Oid ind, const IndexInfo *indexInfo);
 extern void build_indices(void);
 
 extern void boot_get_type_io_data(Oid typid,
index d01ab504b6f2a13dff2478afc600161fbbb43bf1..c472ee13654a74f2a9b8e463cbd21bf4fa351855 100644 (file)
@@ -97,7 +97,7 @@ extern List *heap_truncate_find_FKs(List *relationIds);
 extern void InsertPgAttributeTuples(Relation pg_attribute_rel,
                                    TupleDesc tupdesc,
                                    Oid new_rel_oid,
-                                   Datum *attoptions,
+                                   const Datum *attoptions,
                                    CatalogIndexState indstate);
 
 extern void InsertPgClassTuple(Relation pg_class_desc,
index c8532fb97c810640884c9cabf87ef8db430b483b..72ac2dc1b10e8762f2376fc34b8202262a91dcf2 100644 (file)
@@ -54,9 +54,9 @@ typedef struct ValidateIndexState
 } ValidateIndexState;
 
 extern void index_check_primary_key(Relation heapRel,
-                                   IndexInfo *indexInfo,
+                                   const IndexInfo *indexInfo,
                                    bool is_alter_table,
-                                   IndexStmt *stmt);
+                                   const IndexStmt *stmt);
 
 #define    INDEX_CREATE_IS_PRIMARY             (1 << 0)
 #define    INDEX_CREATE_ADD_CONSTRAINT         (1 << 1)
@@ -73,12 +73,12 @@ extern Oid  index_create(Relation heapRelation,
                         Oid parentConstraintId,
                         RelFileNumber relFileNumber,
                         IndexInfo *indexInfo,
-                        List *indexColNames,
+                        const List *indexColNames,
                         Oid accessMethodObjectId,
                         Oid tableSpaceId,
-                        Oid *collationObjectId,
-                        Oid *classObjectId,
-                        int16 *coloptions,
+                        const Oid *collationObjectId,
+                        const Oid *classObjectId,
+                        const int16 *coloptions,
                         Datum reloptions,
                         bits16 flags,
                         bits16 constr_flags,
@@ -110,7 +110,7 @@ extern void index_concurrently_set_dead(Oid heapId,
 extern ObjectAddress index_constraint_create(Relation heapRelation,
                                             Oid indexRelationId,
                                             Oid parentConstraintId,
-                                            IndexInfo *indexInfo,
+                                            const IndexInfo *indexInfo,
                                             const char *constraintName,
                                             char constraintType,
                                             bits16 constr_flags,
@@ -123,10 +123,10 @@ extern IndexInfo *BuildIndexInfo(Relation index);
 
 extern IndexInfo *BuildDummyIndexInfo(Relation index);
 
-extern bool CompareIndexInfo(IndexInfo *info1, IndexInfo *info2,
-                            Oid *collations1, Oid *collations2,
-                            Oid *opfamilies1, Oid *opfamilies2,
-                            AttrMap *attmap);
+extern bool CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2,
+                            const Oid *collations1, const Oid *collations2,
+                            const Oid *opfamilies1, const Oid *opfamilies2,
+                            const AttrMap *attmap);
 
 extern void BuildSpeculativeIndexInfo(Relation index, IndexInfo *ii);
 
@@ -149,7 +149,7 @@ extern void index_set_state_flags(Oid indexId, IndexStateFlagsAction action);
 extern Oid IndexGetRelation(Oid indexId, bool missing_ok);
 
 extern void reindex_index(Oid indexId, bool skip_constraint_checks,
-                         char persistence, ReindexParams *params);
+                         char persistence, const ReindexParams *params);
 
 /* Flag bits for reindex_relation(): */
 #define REINDEX_REL_PROCESS_TOAST          0x01
@@ -158,7 +158,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, ReindexParams *params);
+extern bool reindex_relation(Oid relid, int flags, const ReindexParams *params);
 
 extern bool ReindexIsProcessingHeap(Oid heapOid);
 extern bool ReindexIsProcessingIndex(Oid indexOid);
@@ -166,7 +166,7 @@ extern bool ReindexIsProcessingIndex(Oid indexOid);
 extern void ResetReindexState(int nestLevel);
 extern Size EstimateReindexStateSpace(void);
 extern void SerializeReindexState(Size maxsize, char *start_address);
-extern void RestoreReindexState(void *reindexstate);
+extern void RestoreReindexState(const void *reindexstate);
 
 extern void IndexSetParentIndex(Relation partitionIdx, Oid parentOid);
 
index 49ef619e4b8c7010c2e21404550e6557eabcc4cd..e0279404305fb06349552a25335094f5f36a59e1 100644 (file)
@@ -136,7 +136,7 @@ extern bool TSTemplateIsVisible(Oid tmplId);
 extern Oid get_ts_config_oid(List *names, bool missing_ok);
 extern bool TSConfigIsVisible(Oid cfgid);
 
-extern void DeconstructQualifiedName(List *names,
+extern void DeconstructQualifiedName(const List *names,
                                     char **nspname_p,
                                     char **objname_p);
 extern Oid LookupNamespaceNoError(const char *nspname);
@@ -145,10 +145,10 @@ extern Oid    get_namespace_oid(const char *nspname, bool missing_ok);
 
 extern Oid LookupCreationNamespace(const char *nspname);
 extern void CheckSetNamespace(Oid oldNspOid, Oid nspOid);
-extern Oid QualifiedNameGetCreationNamespace(List *names, char **objname_p);
-extern RangeVar *makeRangeVarFromNameList(List *names);
-extern char *NameListToString(List *names);
-extern char *NameListToQuotedString(List *names);
+extern Oid QualifiedNameGetCreationNamespace(const List *names, char **objname_p);
+extern RangeVar *makeRangeVarFromNameList(const List *names);
+extern char *NameListToString(const List *names);
+extern char *NameListToQuotedString(const List *names);
 
 extern bool isTempNamespace(Oid namespaceId);
 extern bool isTempToastNamespace(Oid namespaceId);
index 478203ed4c4d35aff73fd7d444da04d3fb75e64d..190040d463830ec3eafba20a0490777a9b7e04a9 100644 (file)
@@ -35,7 +35,7 @@ extern ObjectAddress DefineIndex(Oid relationId,
                                 bool check_not_in_use,
                                 bool skip_build,
                                 bool quiet);
-extern void ExecReindex(ParseState *pstate, ReindexStmt *stmt, bool isTopLevel);
+extern void ExecReindex(ParseState *pstate, const ReindexStmt *stmt, bool isTopLevel);
 extern char *makeObjectName(const char *name1, const char *name2,
                            const char *label);
 extern char *ChooseRelationName(const char *name1, const char *name2,
@@ -43,10 +43,10 @@ extern char *ChooseRelationName(const char *name1, const char *name2,
                                bool isconstraint);
 extern bool CheckIndexCompatible(Oid oldId,
                                 const char *accessMethodName,
-                                List *attributeList,
-                                List *exclusionOpNames);
+                                const List *attributeList,
+                                const List *exclusionOpNames);
 extern Oid GetDefaultOpClass(Oid type_id, Oid am_id);
-extern Oid ResolveOpClass(List *opclass, Oid attrType,
+extern Oid ResolveOpClass(const List *opclass, Oid attrType,
                           const char *accessMethodName, Oid accessMethodId);
 
 /* commands/functioncmds.c */