diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2023-08-23 06:14:11 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2023-08-23 06:39:39 +0200 |
| commit | 11af63fb48d278b86aa948a5b57f136ef03c2bb7 (patch) | |
| tree | 78f89e389fef01388c7af690f7106a52d01e2d5b /src/include | |
| parent | f4b54e1ed9853ab9aff524494866823f951b1e7f (diff) | |
Add const decorations
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
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/bootstrap/bootstrap.h | 2 | ||||
| -rw-r--r-- | src/include/catalog/heap.h | 2 | ||||
| -rw-r--r-- | src/include/catalog/index.h | 28 | ||||
| -rw-r--r-- | src/include/catalog/namespace.h | 10 | ||||
| -rw-r--r-- | src/include/commands/defrem.h | 8 |
5 files changed, 25 insertions, 25 deletions
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index 2c28a52ce71..e1cb73c5f2e 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -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, diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h index d01ab504b6f..c472ee13654 100644 --- a/src/include/catalog/heap.h +++ b/src/include/catalog/heap.h @@ -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, diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h index c8532fb97c8..72ac2dc1b10 100644 --- a/src/include/catalog/index.h +++ b/src/include/catalog/index.h @@ -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); diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h index 49ef619e4b8..e0279404305 100644 --- a/src/include/catalog/namespace.h +++ b/src/include/catalog/namespace.h @@ -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); diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 478203ed4c4..190040d4638 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -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 */ |
