PostgreSQL Source Code: src/backend/utils/cache/attoptcache.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
18
26
27
28
30
31
32typedef struct
33{
37
38typedef struct
39{
43
44
45
46
47
48
49
50
51
52static void
54{
57
58
59
60
61
62
63 if (hashvalue == 0)
65 else
67
69 {
70 if (attopt->opts)
73 &attopt->key,
75 NULL) == NULL)
76 elog(ERROR, "hash table corrupted");
77 }
78}
79
80
81
82
85{
87
88 Assert(keysize == sizeof(*ckey));
90}
91
92
93
94
95
96static void
98{
100
101
104
105
106
107
108
109
111
115
116
119
120
124}
125
126
127
128
129
132{
137
138
141 memset(&key, 0, sizeof(key));
142 key.attrelid = attrelid;
144 attopt =
148 NULL);
149
150
151 if (!attopt)
152 {
154
158
159
160
161
162
163
166 else
167 {
169 bool isNull;
170
172 tp,
173 Anum_pg_attribute_attoptions,
174 &isNull);
175 if (isNull)
177 else
178 {
180
183 memcpy(opts, bytea_opts, VARSIZE(bytea_opts));
184 }
186 }
187
188
189
190
191
195 NULL);
197 }
198
199
200 if (attopt->opts == NULL)
201 return NULL;
204 return result;
205}
static uint32 relatt_cache_syshash(const void *key, Size keysize)
AttributeOpts * get_attribute_options(Oid attrelid, int attnum)
static HTAB * AttoptCacheHash
static void InvalidateAttoptCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
static void InitializeAttoptCache(void)
void CreateCacheMemoryContext(void)
void hash_seq_init_with_hash_value(HASH_SEQ_STATUS *status, HTAB *hashp, uint32 hashvalue)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
void * hash_seq_search(HASH_SEQ_STATUS *status)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
Assert(PointerIsAligned(start, uint64))
#define HeapTupleIsValid(tuple)
void CacheRegisterSyscacheCallback(int cacheid, SyscacheCallbackFunction func, Datum arg)
void * MemoryContextAlloc(MemoryContext context, Size size)
void pfree(void *pointer)
MemoryContext CacheMemoryContext
static AmcheckOptions opts
static Datum Int16GetDatum(int16 X)
static Datum ObjectIdGetDatum(Oid X)
bytea * attribute_reloptions(Datum reloptions, bool validate)
void ReleaseSysCache(HeapTuple tuple)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
#define GetSysCacheHashValue2(cacheId, key1, key2)