130{
134 int raw_page_size;
135
138 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
139 errmsg(
"must be superuser to use raw page functions")));
140
142
144 {
147
150 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
151 errmsg(
"input page too small (%d bytes)", raw_page_size)));
152
155
157
158
160 elog(
ERROR,
"return type must be a row type");
161
162 inter_call_data->
tupd = tupdesc;
163
166
169
171 }
172
175
177 {
183 bool nulls[14];
187
188 memset(nulls, 0, sizeof(nulls));
189
190
191
193
197
202
203
204
205
206
207
211 lp_offset + lp_len <= raw_page_size)
212 {
214 bytea *tuple_data_bytea;
215 int tuple_data_len;
216
217
218
220
223
229
230
231 tuple_data_len = lp_len - tuphdr->
t_hoff;
234 memcpy(
VARDATA(tuple_data_bytea), (
char *) tuphdr + tuphdr->
t_hoff,
235 tuple_data_len);
237
238
239
240
241
242
243
245 tuphdr->
t_hoff <= lp_len &&
247 {
249 {
250 int bits_len;
251
252 bits_len =
255 }
256 else
257 nulls[11] = true;
258
261 else
262 nulls[12] = true;
263 }
264 else
265 {
266 nulls[11] = true;
267 nulls[12] = true;
268 }
269 }
270 else
271 {
272
273
274
275
277
278 for (
i = 4;
i <= 13;
i++)
280 }
281
282
285
286 inter_call_data->
offset++;
287
289 }
290 else
292}
static Datum values[MAXATTR]
static Item PageGetItem(Page page, ItemId itemId)
#define SizeOfPageHeaderData
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static OffsetNumber PageGetMaxOffsetNumber(Page page)
#define CStringGetTextDatum(s)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_BYTEA_P(n)
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)
#define HeapTupleHeaderGetOidOld(tup)
static char * bits_to_text(bits8 *bits, int len)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
HeapTupleHeaderData * HeapTupleHeader
#define HeapTupleHeaderGetNatts(tup)
#define SizeofHeapTupleHeader
#define HeapTupleHeaderGetRawXmin(tup)
#define HeapTupleHeaderGetRawXmax(tup)
#define HeapTupleHeaderGetRawCommandId(tup)
#define ItemIdGetLength(itemId)
#define ItemIdGetOffset(itemId)
#define ItemIdGetFlags(itemId)
#define ItemIdHasStorage(itemId)
#define FirstOffsetNumber
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static Datum PointerGetDatum(const void *X)
static Datum UInt16GetDatum(uint16 X)
static Datum UInt8GetDatum(uint8 X)
static Datum UInt32GetDatum(uint32 X)
MemoryContext multi_call_memory_ctx
#define SET_VARSIZE(PTR, len)