PostgreSQL Source Code  git master
brinfuncs.c File Reference
#include "postgres.h"
#include "access/brin.h"
#include "access/brin_internal.h"
#include "access/brin_page.h"
#include "access/brin_revmap.h"
#include "access/brin_tuple.h"
#include "access/htup_details.h"
#include "catalog/index.h"
#include "catalog/pg_am_d.h"
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "pageinspect.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
Include dependency graph for brinfuncs.c:

Go to the source code of this file.

Data Structures

struct  brin_column_state
 

Macros

#define IS_BRIN(r)   ((r)->rd_rel->relam == BRIN_AM_OID)
 

Typedefs

typedef struct brin_column_state brin_column_state
 

Functions

 PG_FUNCTION_INFO_V1 (brin_page_type)
 
 PG_FUNCTION_INFO_V1 (brin_page_items)
 
 PG_FUNCTION_INFO_V1 (brin_metapage_info)
 
 PG_FUNCTION_INFO_V1 (brin_revmap_data)
 
static Page verify_brin_page (bytea *raw_page, uint16 type, const char *strtype)
 
Datum brin_page_type (PG_FUNCTION_ARGS)
 
Datum brin_page_items (PG_FUNCTION_ARGS)
 
Datum brin_metapage_info (PG_FUNCTION_ARGS)
 
Datum brin_revmap_data (PG_FUNCTION_ARGS)
 

Macro Definition Documentation

◆ IS_BRIN

#define IS_BRIN (   r)    ((r)->rd_rel->relam == BRIN_AM_OID)

Definition at line 35 of file brinfuncs.c.

Typedef Documentation

◆ brin_column_state

Function Documentation

◆ brin_metapage_info()

Datum brin_metapage_info ( PG_FUNCTION_ARGS  )

Definition at line 328 of file brinfuncs.c.

329 {
330  bytea *raw_page = PG_GETARG_BYTEA_P(0);
331  Page page;
332  BrinMetaPageData *meta;
333  TupleDesc tupdesc;
334  Datum values[4];
335  bool nulls[4] = {0};
336  HeapTuple htup;
337 
338  if (!superuser())
339  ereport(ERROR,
340  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
341  errmsg("must be superuser to use raw page functions")));
342 
343  page = verify_brin_page(raw_page, BRIN_PAGETYPE_META, "metapage");
344 
345  if (PageIsNew(page))
346  PG_RETURN_NULL();
347 
348  /* Build a tuple descriptor for our result type */
349  if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
350  elog(ERROR, "return type must be a row type");
351  tupdesc = BlessTupleDesc(tupdesc);
352 
353  /* Extract values from the metapage */
354  meta = (BrinMetaPageData *) PageGetContents(page);
355  values[0] = CStringGetTextDatum(psprintf("0x%08X", meta->brinMagic));
356  values[1] = Int32GetDatum(meta->brinVersion);
357  values[2] = Int32GetDatum(meta->pagesPerRange);
358  values[3] = Int64GetDatum(meta->lastRevmapPage);
359 
360  htup = heap_form_tuple(tupdesc, values, nulls);
361 
363 }
static Datum values[MAXATTR]
Definition: bootstrap.c:156
#define BRIN_PAGETYPE_META
Definition: brin_page.h:51
static Page verify_brin_page(bytea *raw_page, uint16 type, const char *strtype)
Definition: brinfuncs.c:97
static char * PageGetContents(Page page)
Definition: bufpage.h:254
Pointer Page
Definition: bufpage.h:78
static bool PageIsNew(Page page)
Definition: bufpage.h:230
#define CStringGetTextDatum(s)
Definition: builtins.h:85
int errcode(int sqlerrcode)
Definition: elog.c:695
int errmsg(const char *fmt,...)
Definition: elog.c:906
#define ERROR
Definition: elog.h:35
#define ereport(elevel,...)
Definition: elog.h:145
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
Definition: execTuples.c:2071
Datum Int64GetDatum(int64 X)
Definition: fmgr.c:1683
#define PG_RETURN_NULL()
Definition: fmgr.h:345
#define PG_RETURN_DATUM(x)
Definition: fmgr.h:353
#define PG_GETARG_BYTEA_P(n)
Definition: fmgr.h:335
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
Definition: funcapi.c:276
@ TYPEFUNC_COMPOSITE
Definition: funcapi.h:149
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
Definition: funcapi.h:230
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
Definition: heaptuple.c:1020
uintptr_t Datum
Definition: postgres.h:412
static Datum Int32GetDatum(int32 X)
Definition: postgres.h:560
char * psprintf(const char *fmt,...)
Definition: psprintf.c:46
uint32 brinVersion
Definition: brin_page.h:67
uint32 brinMagic
Definition: brin_page.h:66
BlockNumber lastRevmapPage
Definition: brin_page.h:69
BlockNumber pagesPerRange
Definition: brin_page.h:68
Definition: c.h:623
bool superuser(void)
Definition: superuser.c:46

References BlessTupleDesc(), BRIN_PAGETYPE_META, BrinMetaPageData::brinMagic, BrinMetaPageData::brinVersion, CStringGetTextDatum, elog(), ereport, errcode(), errmsg(), ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int32GetDatum(), Int64GetDatum(), BrinMetaPageData::lastRevmapPage, PageGetContents(), PageIsNew(), BrinMetaPageData::pagesPerRange, PG_GETARG_BYTEA_P, PG_RETURN_DATUM, PG_RETURN_NULL, psprintf(), superuser(), TYPEFUNC_COMPOSITE, values, and verify_brin_page().

◆ brin_page_items()

Datum brin_page_items ( PG_FUNCTION_ARGS  )

Definition at line 131 of file brinfuncs.c.

132 {
133  bytea *raw_page = PG_GETARG_BYTEA_P(0);
134  Oid indexRelid = PG_GETARG_OID(1);
135  ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
136  Relation indexRel;
137  brin_column_state **columns;
138  BrinDesc *bdesc;
139  BrinMemTuple *dtup;
140  Page page;
141  OffsetNumber offset;
142  AttrNumber attno;
143  bool unusedItem;
144 
145  if (!superuser())
146  ereport(ERROR,
147  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
148  errmsg("must be superuser to use raw page functions")));
149 
150  InitMaterializedSRF(fcinfo, 0);
151 
152  indexRel = index_open(indexRelid, AccessShareLock);
153 
154  if (!IS_BRIN(indexRel))
155  ereport(ERROR,
156  (errcode(ERRCODE_WRONG_OBJECT_TYPE),
157  errmsg("\"%s\" is not a %s index",
158  RelationGetRelationName(indexRel), "BRIN")));
159 
160  bdesc = brin_build_desc(indexRel);
161 
162  /* minimally verify the page we got */
163  page = verify_brin_page(raw_page, BRIN_PAGETYPE_REGULAR, "regular");
164 
165  if (PageIsNew(page))
166  {
167  brin_free_desc(bdesc);
168  index_close(indexRel, AccessShareLock);
169  PG_RETURN_NULL();
170  }
171 
172  /*
173  * Initialize output functions for all indexed datatypes; simplifies
174  * calling them later.
175  */
176  columns = palloc(sizeof(brin_column_state *) * RelationGetDescr(indexRel)->natts);
177  for (attno = 1; attno <= bdesc->bd_tupdesc->natts; attno++)
178  {
179  Oid output;
180  bool isVarlena;
181  BrinOpcInfo *opcinfo;
182  int i;
183  brin_column_state *column;
184 
185  opcinfo = bdesc->bd_info[attno - 1];
186  column = palloc(offsetof(brin_column_state, outputFn) +
187  sizeof(FmgrInfo) * opcinfo->oi_nstored);
188 
189  column->nstored = opcinfo->oi_nstored;
190  for (i = 0; i < opcinfo->oi_nstored; i++)
191  {
192  getTypeOutputInfo(opcinfo->oi_typcache[i]->type_id, &output, &isVarlena);
193  fmgr_info(output, &column->outputFn[i]);
194  }
195 
196  columns[attno - 1] = column;
197  }
198 
199  offset = FirstOffsetNumber;
200  unusedItem = false;
201  dtup = NULL;
202  for (;;)
203  {
204  Datum values[7];
205  bool nulls[7] = {0};
206 
207  /*
208  * This loop is called once for every attribute of every tuple in the
209  * page. At the start of a tuple, we get a NULL dtup; that's our
210  * signal for obtaining and decoding the next one. If that's not the
211  * case, we output the next attribute.
212  */
213  if (dtup == NULL)
214  {
215  ItemId itemId;
216 
217  /* verify item status: if there's no data, we can't decode */
218  itemId = PageGetItemId(page, offset);
219  if (ItemIdIsUsed(itemId))
220  {
221  dtup = brin_deform_tuple(bdesc,
222  (BrinTuple *) PageGetItem(page, itemId),
223  NULL);
224  attno = 1;
225  unusedItem = false;
226  }
227  else
228  unusedItem = true;
229  }
230  else
231  attno++;
232 
233  if (unusedItem)
234  {
235  values[0] = UInt16GetDatum(offset);
236  nulls[1] = true;
237  nulls[2] = true;
238  nulls[3] = true;
239  nulls[4] = true;
240  nulls[5] = true;
241  nulls[6] = true;
242  }
243  else
244  {
245  int att = attno - 1;
246 
247  values[0] = UInt16GetDatum(offset);
248  switch (TupleDescAttr(rsinfo->setDesc, 1)->atttypid)
249  {
250  case INT8OID:
251  values[1] = Int64GetDatum((int64) dtup->bt_blkno);
252  break;
253  case INT4OID:
254  /* support for old extension version */
255  values[1] = UInt32GetDatum(dtup->bt_blkno);
256  break;
257  default:
258  elog(ERROR, "incorrect output types");
259  }
260  values[2] = UInt16GetDatum(attno);
261  values[3] = BoolGetDatum(dtup->bt_columns[att].bv_allnulls);
262  values[4] = BoolGetDatum(dtup->bt_columns[att].bv_hasnulls);
263  values[5] = BoolGetDatum(dtup->bt_placeholder);
264  if (!dtup->bt_columns[att].bv_allnulls)
265  {
266  BrinValues *bvalues = &dtup->bt_columns[att];
267  StringInfoData s;
268  bool first;
269  int i;
270 
271  initStringInfo(&s);
272  appendStringInfoChar(&s, '{');
273 
274  first = true;
275  for (i = 0; i < columns[att]->nstored; i++)
276  {
277  char *val;
278 
279  if (!first)
280  appendStringInfoString(&s, " .. ");
281  first = false;
282  val = OutputFunctionCall(&columns[att]->outputFn[i],
283  bvalues->bv_values[i]);
285  pfree(val);
286  }
287  appendStringInfoChar(&s, '}');
288 
290  pfree(s.data);
291  }
292  else
293  {
294  nulls[6] = true;
295  }
296  }
297 
298  tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc, values, nulls);
299 
300  /*
301  * If the item was unused, jump straight to the next one; otherwise,
302  * the only cleanup needed here is to set our signal to go to the next
303  * tuple in the following iteration, by freeing the current one.
304  */
305  if (unusedItem)
306  offset = OffsetNumberNext(offset);
307  else if (attno >= bdesc->bd_tupdesc->natts)
308  {
309  pfree(dtup);
310  dtup = NULL;
311  offset = OffsetNumberNext(offset);
312  }
313 
314  /*
315  * If we're beyond the end of the page, we're done.
316  */
317  if (offset > PageGetMaxOffsetNumber(page))
318  break;
319  }
320 
321  brin_free_desc(bdesc);
322  index_close(indexRel, AccessShareLock);
323 
324  return (Datum) 0;
325 }
int16 AttrNumber
Definition: attnum.h:21
void brin_free_desc(BrinDesc *bdesc)
Definition: brin.c:1242
BrinDesc * brin_build_desc(Relation rel)
Definition: brin.c:1187
#define BRIN_PAGETYPE_REGULAR
Definition: brin_page.h:53
BrinMemTuple * brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple, BrinMemTuple *dMemtuple)
Definition: brin_tuple.c:546
#define IS_BRIN(r)
Definition: brinfuncs.c:35
static Item PageGetItem(Page page, ItemId itemId)
Definition: bufpage.h:351
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
Definition: bufpage.h:240
static OffsetNumber PageGetMaxOffsetNumber(Page page)
Definition: bufpage.h:369
void fmgr_info(Oid functionId, FmgrInfo *finfo)
Definition: fmgr.c:126
char * OutputFunctionCall(FmgrInfo *flinfo, Datum val)
Definition: fmgr.c:1559
#define PG_GETARG_OID(n)
Definition: fmgr.h:275
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
Definition: funcapi.c:76
void index_close(Relation relation, LOCKMODE lockmode)
Definition: indexam.c:158
Relation index_open(Oid relationId, LOCKMODE lockmode)
Definition: indexam.c:132
long val
Definition: informix.c:664
int i
Definition: isn.c:73
if(TABLE==NULL||TABLE_index==NULL)
Definition: isn.c:77
#define ItemIdIsUsed(itemId)
Definition: itemid.h:92
#define AccessShareLock
Definition: lockdefs.h:36
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
Definition: lsyscache.c:2865
void pfree(void *pointer)
Definition: mcxt.c:1306
void * palloc(Size size)
Definition: mcxt.c:1199
#define OffsetNumberNext(offsetNumber)
Definition: off.h:52
uint16 OffsetNumber
Definition: off.h:24
#define FirstOffsetNumber
Definition: off.h:27
static void output(uint64 loop_count)
static Datum UInt16GetDatum(uint16 X)
Definition: postgres.h:540
static Datum BoolGetDatum(bool X)
Definition: postgres.h:450
static Datum UInt32GetDatum(uint32 X)
Definition: postgres.h:580
unsigned int Oid
Definition: postgres_ext.h:31
#define RelationGetDescr(relation)
Definition: rel.h:527
#define RelationGetRelationName(relation)
Definition: rel.h:535
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:176
void appendStringInfoChar(StringInfo str, char ch)
Definition: stringinfo.c:188
void initStringInfo(StringInfo str)
Definition: stringinfo.c:59
TypeCacheEntry * oi_typcache[FLEXIBLE_ARRAY_MEMBER]
Definition: brin_internal.h:37
uint16 oi_nstored
Definition: brin_internal.h:28
Datum * bv_values
Definition: brin_tuple.h:34
Definition: fmgr.h:57
TupleDesc setDesc
Definition: execnodes.h:332
Tuplestorestate * setResult
Definition: execnodes.h:331
FmgrInfo outputFn[FLEXIBLE_ARRAY_MEMBER]
Definition: brinfuncs.c:40
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, Datum *values, bool *isnull)
Definition: tuplestore.c:750

References AccessShareLock, appendStringInfoChar(), appendStringInfoString(), BoolGetDatum(), brin_build_desc(), brin_deform_tuple(), brin_free_desc(), BRIN_PAGETYPE_REGULAR, BrinValues::bv_values, CStringGetTextDatum, StringInfoData::data, elog(), ereport, errcode(), errmsg(), ERROR, FirstOffsetNumber, fmgr_info(), getTypeOutputInfo(), i, if(), index_close(), index_open(), InitMaterializedSRF(), initStringInfo(), Int64GetDatum(), IS_BRIN, ItemIdIsUsed, brin_column_state::nstored, OffsetNumberNext, BrinOpcInfo::oi_nstored, BrinOpcInfo::oi_typcache, output(), brin_column_state::outputFn, OutputFunctionCall(), PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageIsNew(), palloc(), pfree(), PG_GETARG_BYTEA_P, PG_GETARG_OID, PG_RETURN_NULL, RelationGetDescr, RelationGetRelationName, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, superuser(), TupleDescAttr, tuplestore_putvalues(), TypeCacheEntry::type_id, UInt16GetDatum(), UInt32GetDatum(), val, values, and verify_brin_page().

◆ brin_page_type()

Datum brin_page_type ( PG_FUNCTION_ARGS  )

Definition at line 48 of file brinfuncs.c.

49 {
50  bytea *raw_page = PG_GETARG_BYTEA_P(0);
51  Page page;
52  char *type;
53 
54  if (!superuser())
55  ereport(ERROR,
56  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
57  errmsg("must be superuser to use raw page functions")));
58 
59  page = get_page_from_raw(raw_page);
60 
61  if (PageIsNew(page))
63 
64  /* verify the special space has the expected size */
65  if (PageGetSpecialSize(page) != MAXALIGN(sizeof(BrinSpecialSpace)))
66  ereport(ERROR,
67  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
68  errmsg("input page is not a valid %s page", "BRIN"),
69  errdetail("Expected special size %d, got %d.",
70  (int) MAXALIGN(sizeof(BrinSpecialSpace)),
71  (int) PageGetSpecialSize(page))));
72 
73  switch (BrinPageType(page))
74  {
75  case BRIN_PAGETYPE_META:
76  type = "meta";
77  break;
79  type = "revmap";
80  break;
82  type = "regular";
83  break;
84  default:
85  type = psprintf("unknown (%02x)", BrinPageType(page));
86  break;
87  }
88 
90 }
#define BRIN_PAGETYPE_REVMAP
Definition: brin_page.h:52
#define BrinPageType(page)
Definition: brin_page.h:42
static uint16 PageGetSpecialSize(Page page)
Definition: bufpage.h:313
#define MAXALIGN(LEN)
Definition: c.h:747
int errdetail(const char *fmt,...)
Definition: elog.c:1039
#define PG_RETURN_TEXT_P(x)
Definition: fmgr.h:372
Page get_page_from_raw(bytea *raw_page)
Definition: rawpage.c:215
text * cstring_to_text(const char *s)
Definition: varlena.c:189

References BRIN_PAGETYPE_META, BRIN_PAGETYPE_REGULAR, BRIN_PAGETYPE_REVMAP, BrinPageType, cstring_to_text(), ereport, errcode(), errdetail(), errmsg(), ERROR, get_page_from_raw(), MAXALIGN, PageGetSpecialSize(), PageIsNew(), PG_GETARG_BYTEA_P, PG_RETURN_NULL, PG_RETURN_TEXT_P, psprintf(), superuser(), and generate_unaccent_rules::type.

◆ brin_revmap_data()

Datum brin_revmap_data ( PG_FUNCTION_ARGS  )

Definition at line 369 of file brinfuncs.c.

370 {
371  struct
372  {
373  ItemPointerData *tids;
374  int idx;
375  } *state;
376  FuncCallContext *fctx;
377 
378  if (!superuser())
379  ereport(ERROR,
380  (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
381  errmsg("must be superuser to use raw page functions")));
382 
383  if (SRF_IS_FIRSTCALL())
384  {
385  bytea *raw_page = PG_GETARG_BYTEA_P(0);
386  MemoryContext mctx;
387  Page page;
388 
389  /* create a function context for cross-call persistence */
390  fctx = SRF_FIRSTCALL_INIT();
391 
392  /* switch to memory context appropriate for multiple function calls */
394 
395  /* minimally verify the page we got */
396  page = verify_brin_page(raw_page, BRIN_PAGETYPE_REVMAP, "revmap");
397 
398  if (PageIsNew(page))
399  {
400  MemoryContextSwitchTo(mctx);
401  PG_RETURN_NULL();
402  }
403 
404  state = palloc(sizeof(*state));
405  state->tids = ((RevmapContents *) PageGetContents(page))->rm_tids;
406  state->idx = 0;
407 
408  fctx->user_fctx = state;
409 
410  MemoryContextSwitchTo(mctx);
411  }
412 
413  fctx = SRF_PERCALL_SETUP();
414  state = fctx->user_fctx;
415 
416  if (state->idx < REVMAP_PAGE_MAXITEMS)
417  SRF_RETURN_NEXT(fctx, PointerGetDatum(&state->tids[state->idx++]));
418 
419  SRF_RETURN_DONE(fctx);
420 }
Datum idx(PG_FUNCTION_ARGS)
Definition: _int_op.c:259
#define REVMAP_PAGE_MAXITEMS
Definition: brin_page.h:93
#define SRF_IS_FIRSTCALL()
Definition: funcapi.h:303
#define SRF_PERCALL_SETUP()
Definition: funcapi.h:307
#define SRF_RETURN_NEXT(_funcctx, _result)
Definition: funcapi.h:309
#define SRF_FIRSTCALL_INIT()
Definition: funcapi.h:305
#define SRF_RETURN_DONE(_funcctx)
Definition: funcapi.h:327
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:135
static Datum PointerGetDatum(const void *X)
Definition: postgres.h:670
void * user_fctx
Definition: funcapi.h:82
MemoryContext multi_call_memory_ctx
Definition: funcapi.h:101
Definition: regguts.h:318

References BRIN_PAGETYPE_REVMAP, ereport, errcode(), errmsg(), ERROR, idx(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, PageGetContents(), PageIsNew(), palloc(), PG_GETARG_BYTEA_P, PG_RETURN_NULL, PointerGetDatum(), REVMAP_PAGE_MAXITEMS, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, superuser(), FuncCallContext::user_fctx, and verify_brin_page().

◆ PG_FUNCTION_INFO_V1() [1/4]

PG_FUNCTION_INFO_V1 ( brin_metapage_info  )

◆ PG_FUNCTION_INFO_V1() [2/4]

PG_FUNCTION_INFO_V1 ( brin_page_items  )

◆ PG_FUNCTION_INFO_V1() [3/4]

PG_FUNCTION_INFO_V1 ( brin_page_type  )

◆ PG_FUNCTION_INFO_V1() [4/4]

PG_FUNCTION_INFO_V1 ( brin_revmap_data  )

◆ verify_brin_page()

static Page verify_brin_page ( bytea raw_page,
uint16  type,
const char *  strtype 
)
static

Definition at line 97 of file brinfuncs.c.

98 {
99  Page page = get_page_from_raw(raw_page);
100 
101  if (PageIsNew(page))
102  return page;
103 
104  /* verify the special space has the expected size */
105  if (PageGetSpecialSize(page) != MAXALIGN(sizeof(BrinSpecialSpace)))
106  ereport(ERROR,
107  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
108  errmsg("input page is not a valid %s page", "BRIN"),
109  errdetail("Expected special size %d, got %d.",
110  (int) MAXALIGN(sizeof(BrinSpecialSpace)),
111  (int) PageGetSpecialSize(page))));
112 
113  /* verify the special space says this page is what we want */
114  if (BrinPageType(page) != type)
115  ereport(ERROR,
116  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
117  errmsg("page is not a BRIN page of type \"%s\"", strtype),
118  errdetail("Expected special type %08x, got %08x.",
119  type, BrinPageType(page))));
120 
121  return page;
122 }

References BrinPageType, ereport, errcode(), errdetail(), errmsg(), ERROR, get_page_from_raw(), MAXALIGN, PageGetSpecialSize(), PageIsNew(), and generate_unaccent_rules::type.

Referenced by brin_metapage_info(), brin_page_items(), and brin_revmap_data().