Definition at line 69 of file pg_buffercache_pages.c.
70{
78
80 {
82
84
85
87
88
90
91
92
93
94
95
96
97
98
100 elog(
ERROR,
"return type must be a row type");
101
104 elog(
ERROR,
"incorrect number of output arguments");
105
106
109 INT4OID, -1, 0);
111 OIDOID, -1, 0);
113 OIDOID, -1, 0);
115 OIDOID, -1, 0);
117 INT2OID, -1, 0);
119 INT8OID, -1, 0);
121 BOOLOID, -1, 0);
123 INT2OID, -1, 0);
124
127 INT4OID, -1, 0);
128
130
131
135
136
139
140
142
143
144
145
146
147
148
149
150
152 {
155
157
159
168
171 else
173
174
177 else
179
181 }
182 }
183
185
186
188
190 {
194
196 nulls[0] = false;
197
198
199
200
201
204 {
205 nulls[1] = true;
206 nulls[2] = true;
207 nulls[3] = true;
208 nulls[4] = true;
209 nulls[5] = true;
210 nulls[6] = true;
211 nulls[7] = true;
212
213 nulls[8] = true;
214 }
215 else
216 {
218 nulls[1] = false;
220 nulls[2] = false;
222 nulls[3] = false;
224 nulls[4] = false;
226 nulls[5] = false;
228 nulls[6] = false;
230 nulls[7] = false;
231
233 nulls[8] = false;
234 }
235
236
239
241 }
242 else
244}
#define InvalidBlockNumber
static Datum values[MAXATTR]
static ForkNumber BufTagGetForkNum(const BufferTag *tag)
static void UnlockBufHdr(BufferDesc *desc, uint32 buf_state)
static RelFileNumber BufTagGetRelNumber(const BufferTag *tag)
#define BUF_STATE_GET_USAGECOUNT(state)
#define BUF_STATE_GET_REFCOUNT(state)
static BufferDesc * GetBufferDescriptor(uint32 id)
static Buffer BufferDescriptorGetBuffer(const BufferDesc *bdesc)
uint32 LockBufHdr(BufferDesc *desc)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
Datum Int64GetDatum(int64 X)
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
#define SRF_IS_FIRSTCALL()
#define SRF_PERCALL_SETUP()
#define SRF_RETURN_NEXT(_funcctx, _result)
#define SRF_FIRSTCALL_INIT()
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
#define SRF_RETURN_DONE(_funcctx)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
MemoryContext CurrentMemoryContext
void * MemoryContextAllocHuge(MemoryContext context, Size size)
#define NUM_BUFFERCACHE_PAGES_MIN_ELEM
#define NUM_BUFFERCACHE_PAGES_ELEM
static Datum Int16GetDatum(int16 X)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum Int32GetDatum(int32 X)
MemoryContextSwitchTo(old_ctx)
BufferCachePagesRec * record
RelFileNumber relfilenumber
MemoryContext multi_call_memory_ctx
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
References BlessTupleDesc(), BufferCachePagesRec::blocknum, buftag::blockNum, BM_DIRTY, BM_TAG_VALID, BM_VALID, BoolGetDatum(), BUF_STATE_GET_REFCOUNT, BUF_STATE_GET_USAGECOUNT, BufferDescriptorGetBuffer(), BufferCachePagesRec::bufferid, BufTagGetForkNum(), BufTagGetRelNumber(), FuncCallContext::call_cntr, CreateTemplateTupleDesc(), CurrentMemoryContext, buftag::dbOid, elog, ERROR, BufferCachePagesRec::forknum, get_call_result_type(), GetBufferDescriptor(), heap_form_tuple(), HeapTupleGetDatum(), i, Int16GetDatum(), Int32GetDatum(), Int64GetDatum(), InvalidBlockNumber, BufferCachePagesRec::isdirty, BufferCachePagesRec::isvalid, LockBufHdr(), FuncCallContext::max_calls, MemoryContextAllocHuge(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, TupleDescData::natts, NBuffers, NUM_BUFFERCACHE_PAGES_ELEM, NUM_BUFFERCACHE_PAGES_MIN_ELEM, ObjectIdGetDatum(), palloc(), BufferCachePagesRec::pinning_backends, BufferCachePagesContext::record, BufferCachePagesRec::reldatabase, BufferCachePagesRec::relfilenumber, BufferCachePagesRec::reltablespace, buftag::spcOid, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, BufferDesc::tag, BufferCachePagesContext::tupdesc, TupleDescInitEntry(), TYPEFUNC_COMPOSITE, UnlockBufHdr(), BufferCachePagesRec::usagecount, FuncCallContext::user_fctx, and values.