PostgreSQL Source Code: src/backend/statistics/relation_stats.c Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

19

26#include "utils/fmgroids.h"

27#include "utils/fmgrprotos.h"

30

31

32

33

34

35

36

47

58

60

61

62

63

64static bool

66{

67 bool result = true;

68 char *nspname;

70 Oid reloid;

74 float reltuples = 0;

84 bool nulls[4] = {0};

87

90

93

97 errmsg("recovery is in progress"),

98 errhint("Statistics cannot be modified during recovery.")));

99

103

105 {

108 }

109

111 {

113 if (reltuples < -1.0)

114 {

117 errmsg("argument \"%s\" must not be less than -1.0", "reltuples")));

118 result = false;

119 }

120 else

122 }

123

125 {

128 }

129

131 {

134 }

135

136

137

138

139

141

144 elog(ERROR, "pg_class entry for relid %u not found", reloid);

145

147

149 {

153 }

154

156 {

160 }

161

163 {

167 }

168

170 {

174 }

175

177 {

180

185 }

186

188

189

191

193

194 return result;

195}

196

197

198

199

200

224

227{

229 bool result = true;

230

234

237 result = false;

238

240 result = false;

241

243}

static Datum values[MAXATTR]

#define TextDatumGetCString(d)

int errcode(int sqlerrcode)

int errhint(const char *fmt,...) pg_attribute_printf(1

#define ereport(elevel,...)

#define PG_GETARG_UINT32(n)

#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)

#define PG_GETARG_DATUM(n)

#define LOCAL_FCINFO(name, nargs)

#define PG_GETARG_FLOAT4(n)

#define PG_RETURN_BOOL(x)

HeapTuple heap_modify_tuple_by_cols(HeapTuple tuple, TupleDesc tupleDesc, int nCols, const int *replCols, const Datum *replValues, const bool *replIsnull)

void heap_freetuple(HeapTuple htup)

#define HeapTupleIsValid(tuple)

static void * GETSTRUCT(const HeapTupleData *tuple)

void CatalogTupleUpdate(Relation heapRel, const ItemPointerData *otid, HeapTuple tup)

#define ShareUpdateExclusiveLock

RangeVar * makeRangeVar(char *schemaname, char *relname, int location)

Oid RangeVarGetRelidExtended(const RangeVar *relation, LOCKMODE lockmode, uint32 flags, RangeVarGetRelidCallback callback, void *callback_arg)

FormData_pg_class * Form_pg_class

static Datum Float4GetDatum(float4 X)

static Datum ObjectIdGetDatum(Oid X)

static Datum UInt32GetDatum(uint32 X)

#define RelationGetDescr(relation)

static struct StatsArgInfo relarginfo[]

@ NUM_RELATION_STATS_ARGS

Datum pg_restore_relation_stats(PG_FUNCTION_ARGS)

static bool relation_statistics_update(FunctionCallInfo fcinfo)

Datum pg_clear_relation_stats(PG_FUNCTION_ARGS)

bool stats_fill_fcinfo_from_arg_pairs(FunctionCallInfo pairs_fcinfo, FunctionCallInfo positional_fcinfo, struct StatsArgInfo *arginfo)

void RangeVarCallbackForStats(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg)

void stats_check_required_arg(FunctionCallInfo fcinfo, struct StatsArgInfo *arginfo, int argnum)

void ReleaseSysCache(HeapTuple tuple)

HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)

void table_close(Relation relation, LOCKMODE lockmode)

Relation table_open(Oid relationId, LOCKMODE lockmode)

void CommandCounterIncrement(void)

bool RecoveryInProgress(void)