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