PostgreSQL Source Code  git master
bootstrap.c File Reference
#include "postgres.h"
#include <unistd.h>
#include <signal.h>
#include "access/genam.h"
#include "access/heapam.h"
#include "access/htup_details.h"
#include "access/tableam.h"
#include "access/toast_compression.h"
#include "access/xact.h"
#include "access/xlog_internal.h"
#include "bootstrap/bootstrap.h"
#include "catalog/index.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_type.h"
#include "common/link-canary.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "pg_getopt.h"
#include "storage/bufmgr.h"
#include "storage/bufpage.h"
#include "storage/condition_variable.h"
#include "storage/ipc.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/relmapper.h"
Include dependency graph for bootstrap.c:

Go to the source code of this file.

Data Structures

struct  typinfo
 
struct  typmap
 
struct  _IndexList
 

Typedefs

typedef struct _IndexList IndexList
 

Functions

static void CheckerModeMain (void)
 
static void bootstrap_signals (void)
 
static Form_pg_attribute AllocateAttribute (void)
 
static void populate_typ_list (void)
 
static Oid gettype (char *type)
 
static void cleanup (void)
 
void BootstrapModeMain (int argc, char *argv[], bool check_only)
 
void boot_openrel (char *relname)
 
void closerel (char *name)
 
void DefineAttr (char *name, char *type, int attnum, int nullness)
 
void InsertOneTuple (void)
 
void InsertOneValue (char *value, int i)
 
void InsertOneNull (int i)
 
void boot_get_type_io_data (Oid typid, int16 *typlen, bool *typbyval, char *typalign, char *typdelim, Oid *typioparam, Oid *typinput, Oid *typoutput)
 
void index_register (Oid heap, Oid ind, IndexInfo *indexInfo)
 
void build_indices (void)
 

Variables

uint32 bootstrap_data_checksum_version = 0
 
Relation boot_reldesc
 
Form_pg_attribute attrtypes [MAXATTR]
 
int numattr
 
static const struct typinfo TypInfo []
 
static const int n_types = sizeof(TypInfo) / sizeof(struct typinfo)
 
static ListTyp = NIL
 
static struct typmapAp = NULL
 
static Datum values [MAXATTR]
 
static bool Nulls [MAXATTR]
 
static MemoryContext nogc = NULL
 
static IndexListILHead = NULL
 

Typedef Documentation

◆ IndexList

typedef struct _IndexList IndexList

Function Documentation

◆ AllocateAttribute()

static Form_pg_attribute AllocateAttribute ( void  )
static

Definition at line 898 of file bootstrap.c.

References ATTRIBUTE_FIXED_PART_SIZE, MemoryContextAllocZero(), and TopMemoryContext.

Referenced by boot_openrel(), and DefineAttr().

899 {
900  return (Form_pg_attribute)
902 }
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:207
#define ATTRIBUTE_FIXED_PART_SIZE
Definition: pg_attribute.h:199
MemoryContext TopMemoryContext
Definition: mcxt.c:48
void * MemoryContextAllocZero(MemoryContext context, Size size)
Definition: mcxt.c:906

◆ boot_get_type_io_data()

void boot_get_type_io_data ( Oid  typid,
int16 typlen,
bool typbyval,
char *  typalign,
char *  typdelim,
Oid typioparam,
Oid typinput,
Oid typoutput 
)

Definition at line 821 of file bootstrap.c.

References typinfo::align, typmap::am_oid, typmap::am_typ, typinfo::byval, typinfo::elem, elog, ERROR, typinfo::inproc, typinfo::len, lfirst, n_types, NIL, typinfo::oid, OidIsValid, and typinfo::outproc.

Referenced by get_type_io_data(), and InsertOneValue().

829 {
830  if (Typ != NIL)
831  {
832  /* We have the boot-time contents of pg_type, so use it */
833  struct typmap *ap = NULL;
834  ListCell *lc;
835 
836  foreach(lc, Typ)
837  {
838  ap = lfirst(lc);
839  if (ap->am_oid == typid)
840  break;
841  }
842 
843  if (!ap || ap->am_oid != typid)
844  elog(ERROR, "type OID %u not found in Typ list", typid);
845 
846  *typlen = ap->am_typ.typlen;
847  *typbyval = ap->am_typ.typbyval;
848  *typalign = ap->am_typ.typalign;
849  *typdelim = ap->am_typ.typdelim;
850 
851  /* XXX this logic must match getTypeIOParam() */
852  if (OidIsValid(ap->am_typ.typelem))
853  *typioparam = ap->am_typ.typelem;
854  else
855  *typioparam = typid;
856 
857  *typinput = ap->am_typ.typinput;
858  *typoutput = ap->am_typ.typoutput;
859  }
860  else
861  {
862  /* We don't have pg_type yet, so use the hard-wired TypInfo array */
863  int typeindex;
864 
865  for (typeindex = 0; typeindex < n_types; typeindex++)
866  {
867  if (TypInfo[typeindex].oid == typid)
868  break;
869  }
870  if (typeindex >= n_types)
871  elog(ERROR, "type OID %u not found in TypInfo", typid);
872 
873  *typlen = TypInfo[typeindex].len;
874  *typbyval = TypInfo[typeindex].byval;
875  *typalign = TypInfo[typeindex].align;
876  /* We assume typdelim is ',' for all boot-time types */
877  *typdelim = ',';
878 
879  /* XXX this logic must match getTypeIOParam() */
880  if (OidIsValid(TypInfo[typeindex].elem))
881  *typioparam = TypInfo[typeindex].elem;
882  else
883  *typioparam = typid;
884 
885  *typinput = TypInfo[typeindex].inproc;
886  *typoutput = TypInfo[typeindex].outproc;
887  }
888 }
#define NIL
Definition: pg_list.h:65
int16 len
Definition: bootstrap.c:83
char align
Definition: bootstrap.c:85
static List * Typ
Definition: bootstrap.c:153
Oid inproc
Definition: bootstrap.c:88
#define OidIsValid(objectId)
Definition: c.h:710
char typalign
Definition: pg_type.h:176
#define ERROR
Definition: elog.h:46
Oid elem
Definition: bootstrap.c:82
#define lfirst(lc)
Definition: pg_list.h:169
FormData_pg_type am_typ
Definition: bootstrap.c:150
static const int n_types
Definition: bootstrap.c:145
static const struct typinfo TypInfo[]
Definition: bootstrap.c:92
bool byval
Definition: bootstrap.c:84
Oid am_oid
Definition: bootstrap.c:149
#define elog(elevel,...)
Definition: elog.h:232
Oid outproc
Definition: bootstrap.c:89

◆ boot_openrel()

void boot_openrel ( char *  relname)

Definition at line 422 of file bootstrap.c.

References AllocateAttribute(), ATTRIBUTE_FIXED_PART_SIZE, attrtypes, closerel(), DEBUG4, elog, i, makeRangeVar(), NAMEDATALEN, NameStr, NIL, NoLock, numattr, populate_typ_list(), RelationData::rd_att, RelationGetNumberOfAttributes, table_openrv(), and TupleDescAttr.

423 {
424  int i;
425 
426  if (strlen(relname) >= NAMEDATALEN)
427  relname[NAMEDATALEN - 1] = '\0';
428 
429  /*
430  * pg_type must be filled before any OPEN command is executed, hence we
431  * can now populate Typ if we haven't yet.
432  */
433  if (Typ == NIL)
435 
436  if (boot_reldesc != NULL)
437  closerel(NULL);
438 
439  elog(DEBUG4, "open relation %s, attrsize %d",
441 
444  for (i = 0; i < numattr; i++)
445  {
446  if (attrtypes[i] == NULL)
448  memmove((char *) attrtypes[i],
449  (char *) TupleDescAttr(boot_reldesc->rd_att, i),
451 
452  {
454 
455  elog(DEBUG4, "create attribute %d name %s len %d num %d type %u",
456  i, NameStr(at->attname), at->attlen, at->attnum,
457  at->atttypid);
458  }
459  }
460 }
#define NIL
Definition: pg_list.h:65
static void populate_typ_list(void)
Definition: bootstrap.c:710
int numattr
Definition: bootstrap.c:66
#define RelationGetNumberOfAttributes(relation)
Definition: rel.h:483
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
Relation boot_reldesc
Definition: bootstrap.c:63
static List * Typ
Definition: bootstrap.c:153
NameData relname
Definition: pg_class.h:38
void closerel(char *name)
Definition: bootstrap.c:467
#define DEBUG4
Definition: elog.h:22
#define NAMEDATALEN
#define NoLock
Definition: lockdefs.h:34
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:207
#define ATTRIBUTE_FIXED_PART_SIZE
Definition: pg_attribute.h:199
TupleDesc rd_att
Definition: rel.h:110
Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode)
Definition: table.c:102
static Form_pg_attribute AllocateAttribute(void)
Definition: bootstrap.c:898
#define elog(elevel,...)
Definition: elog.h:232
int i
#define NameStr(name)
Definition: c.h:681
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition: makefuncs.c:422
Form_pg_attribute attrtypes[MAXATTR]
Definition: bootstrap.c:65

◆ bootstrap_signals()

static void bootstrap_signals ( void  )
static

Definition at line 395 of file bootstrap.c.

References Assert, IsUnderPostmaster, pqsignal(), SIG_DFL, SIGHUP, and SIGQUIT.

Referenced by BootstrapModeMain().

396 {
398 
399  /*
400  * We don't actually need any non-default signal handling in bootstrap
401  * mode; "curl up and die" is a sufficient response for all these cases.
402  * Let's set that handling explicitly, as documentation if nothing else.
403  */
405  pqsignal(SIGINT, SIG_DFL);
406  pqsignal(SIGTERM, SIG_DFL);
408 }
#define SIGQUIT
Definition: win32_port.h:168
bool IsUnderPostmaster
Definition: globals.c:112
#define SIGHUP
Definition: win32_port.h:167
pqsigfunc pqsignal(int signum, pqsigfunc handler)
Definition: signal.c:170
#define SIG_DFL
Definition: win32_port.h:162
#define Assert(condition)
Definition: c.h:804

◆ BootstrapModeMain()

void BootstrapModeMain ( int  argc,
char *  argv[],
bool  check_only 
)

Definition at line 203 of file bootstrap.c.

References Assert, attrtypes, BaseInit(), boot_yyparse(), bootstrap_data_checksum_version, bootstrap_signals(), BootstrapProcessing, BootStrapXLOG(), ChangeToDataDir(), checkDataDir(), CheckerModeMain(), cleanup(), CommitTransactionCommand(), CreateDataDirLockFile(), CreateSharedMemoryAndSemaphores(), elog, ereport, errcode(), errmsg(), ERROR, flag(), free, getopt(), i, IgnoreSystemIndexes, InitializeGUCOptions(), InitializeMaxBackends(), InitPostgres(), InitProcess(), InitStandaloneProcess(), InvalidOid, IsUnderPostmaster, IsValidWalSegSize, MAXATTR, MAXPGPATH, typinfo::name, NormalProcessing, optarg, optind, OutputFileName, ParseLongOption(), pfree(), PG_DATA_CHECKSUM_VERSION, pg_link_canary_is_frontend(), PGC_INTERNAL, PGC_POSTMASTER, PGC_S_ARGV, PGC_S_OVERRIDE, proc_exit(), progname, psprintf(), pstrdup(), RelationMapFinishBootstrap(), SelectConfigFiles(), SetConfigOption(), SetProcessingMode, StartTransactionCommand(), strlcpy(), userDoption, value, WalSegSz, and write_stderr.

Referenced by main().

204 {
205  int i;
206  char *progname = argv[0];
207  int flag;
208  char *userDoption = NULL;
209 
211 
212  InitStandaloneProcess(argv[0]);
213 
214  /* Set defaults, to be overridden by explicit options below */
216 
217  /* an initial --boot or --check should be present */
218  Assert(argc > 1
219  && (strcmp(argv[1], "--boot") == 0
220  || strcmp(argv[1], "--check") == 0));
221  argv++;
222  argc--;
223 
224  while ((flag = getopt(argc, argv, "B:c:d:D:Fkr:X:-:")) != -1)
225  {
226  switch (flag)
227  {
228  case 'B':
229  SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
230  break;
231  case 'D':
232  userDoption = pstrdup(optarg);
233  break;
234  case 'd':
235  {
236  /* Turn on debugging for the bootstrap process. */
237  char *debugstr;
238 
239  debugstr = psprintf("debug%s", optarg);
240  SetConfigOption("log_min_messages", debugstr,
242  SetConfigOption("client_min_messages", debugstr,
244  pfree(debugstr);
245  }
246  break;
247  case 'F':
248  SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
249  break;
250  case 'k':
252  break;
253  case 'r':
255  break;
256  case 'X':
257  {
258  int WalSegSz = strtoul(optarg, NULL, 0);
259 
260  if (!IsValidWalSegSize(WalSegSz))
261  ereport(ERROR,
262  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
263  errmsg("-X requires a power of two value between 1 MB and 1 GB")));
264  SetConfigOption("wal_segment_size", optarg, PGC_INTERNAL,
266  }
267  break;
268  case 'c':
269  case '-':
270  {
271  char *name,
272  *value;
273 
274  ParseLongOption(optarg, &name, &value);
275  if (!value)
276  {
277  if (flag == '-')
278  ereport(ERROR,
279  (errcode(ERRCODE_SYNTAX_ERROR),
280  errmsg("--%s requires a value",
281  optarg)));
282  else
283  ereport(ERROR,
284  (errcode(ERRCODE_SYNTAX_ERROR),
285  errmsg("-c %s requires a value",
286  optarg)));
287  }
288 
290  free(name);
291  if (value)
292  free(value);
293  break;
294  }
295  default:
296  write_stderr("Try \"%s --help\" for more information.\n",
297  progname);
298  proc_exit(1);
299  break;
300  }
301  }
302 
303  if (argc != optind)
304  {
305  write_stderr("%s: invalid command-line arguments\n", progname);
306  proc_exit(1);
307  }
308 
309  /* Acquire configuration parameters */
310  if (!SelectConfigFiles(userDoption, progname))
311  proc_exit(1);
312 
313  /*
314  * Validate we have been given a reasonable-looking DataDir and change
315  * into it
316  */
317  checkDataDir();
318  ChangeToDataDir();
319 
320  CreateDataDirLockFile(false);
321 
323  IgnoreSystemIndexes = true;
324 
326 
328 
329  /*
330  * XXX: It might make sense to move this into its own function at some
331  * point. Right now it seems like it'd cause more code duplication than
332  * it's worth.
333  */
334  if (check_only)
335  {
337  CheckerModeMain();
338  abort();
339  }
340 
341  /*
342  * Do backend-like initialization for bootstrap mode
343  */
344  InitProcess();
345 
346  BaseInit();
347 
349  BootStrapXLOG();
350 
351  /*
352  * To ensure that src/common/link-canary.c is linked into the backend, we
353  * must call it from somewhere. Here is as good as anywhere.
354  */
356  elog(ERROR, "backend is incorrectly linked to frontend functions");
357 
358  InitPostgres(NULL, InvalidOid, NULL, InvalidOid, NULL, false);
359 
360  /* Initialize stuff for bootstrap-file processing */
361  for (i = 0; i < MAXATTR; i++)
362  {
363  attrtypes[i] = NULL;
364  Nulls[i] = false;
365  }
366 
367  /*
368  * Process bootstrap input.
369  */
371  boot_yyparse();
373 
374  /*
375  * We should now know about all mapped relations, so it's okay to write
376  * out the initial relation mapping files.
377  */
379 
380  /* Clean up and exit */
381  cleanup();
382  proc_exit(0);
383 }
#define IsValidWalSegSize(size)
Definition: xlog_internal.h:96
void RelationMapFinishBootstrap(void)
Definition: relmapper.c:560
const char * progname
Definition: main.c:46
char * pstrdup(const char *in)
Definition: mcxt.c:1299
void CommitTransactionCommand(void)
Definition: xact.c:2959
char * psprintf(const char *fmt,...)
Definition: psprintf.c:46
void InitStandaloneProcess(const char *argv0)
Definition: miscinit.c:175
void ParseLongOption(const char *string, char **name, char **value)
Definition: guc.c:11015
int boot_yyparse(void)
#define write_stderr(str)
Definition: parallel.c:186
void proc_exit(int code)
Definition: ipc.c:104
int errcode(int sqlerrcode)
Definition: elog.c:698
#define SetProcessingMode(mode)
Definition: miscadmin.h:412
void BootStrapXLOG(void)
Definition: xlog.c:5284
void BaseInit(void)
Definition: postinit.c:511
bool IgnoreSystemIndexes
Definition: miscinit.c:79
void checkDataDir(void)
Definition: miscinit.c:321
static void bootstrap_signals(void)
Definition: bootstrap.c:395
int getopt(int nargc, char *const *nargv, const char *ostr)
Definition: getopt.c:71
void pfree(void *pointer)
Definition: mcxt.c:1169
int optind
Definition: getopt.c:50
#define ERROR
Definition: elog.h:46
void CreateDataDirLockFile(bool amPostmaster)
Definition: miscinit.c:1292
#define MAXPGPATH
void InitProcess(void)
Definition: proc.c:303
char OutputFileName[MAXPGPATH]
Definition: globals.c:73
void SetConfigOption(const char *name, const char *value, GucContext context, GucSource source)
Definition: guc.c:8123
bool IsUnderPostmaster
Definition: globals.c:112
char * flag(int b)
Definition: test-ctype.c:33
void ChangeToDataDir(void)
Definition: miscinit.c:435
#define MAXATTR
Definition: bootstrap.h:24
bool SelectConfigFiles(const char *userDoption, const char *progname)
Definition: guc.c:5862
static void cleanup(void)
Definition: bootstrap.c:697
#define InvalidOid
Definition: postgres_ext.h:36
static struct @143 value
#define ereport(elevel,...)
Definition: elog.h:157
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, char *out_dbname, bool override_allow_connections)
Definition: postinit.c:572
#define free(a)
Definition: header.h:65
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
#define Assert(condition)
Definition: c.h:804
void StartTransactionCommand(void)
Definition: xact.c:2858
void InitializeMaxBackends(void)
Definition: postinit.c:489
const char * name
Definition: encode.c:561
uint32 WalSegSz
Definition: streamutil.c:34
void CreateSharedMemoryAndSemaphores(void)
Definition: ipci.c:176
static const char * userDoption
Definition: postgres.c:172
#define PG_DATA_CHECKSUM_VERSION
Definition: bufpage.h:200
int errmsg(const char *fmt,...)
Definition: elog.c:909
char * optarg
Definition: getopt.c:52
#define elog(elevel,...)
Definition: elog.h:232
int i
static void CheckerModeMain(void)
Definition: bootstrap.c:185
uint32 bootstrap_data_checksum_version
Definition: bootstrap.c:48
void InitializeGUCOptions(void)
Definition: guc.c:5639
static bool Nulls[MAXATTR]
Definition: bootstrap.c:157
Form_pg_attribute attrtypes[MAXATTR]
Definition: bootstrap.c:65

◆ build_indices()

void build_indices ( void  )

Definition at line 966 of file bootstrap.c.

References _IndexList::il_heap, _IndexList::il_ind, _IndexList::il_info, _IndexList::il_next, index_build(), index_close(), index_open(), NoLock, table_close(), and table_open().

967 {
968  for (; ILHead != NULL; ILHead = ILHead->il_next)
969  {
970  Relation heap;
971  Relation ind;
972 
973  /* need not bother with locks during bootstrap */
974  heap = table_open(ILHead->il_heap, NoLock);
975  ind = index_open(ILHead->il_ind, NoLock);
976 
977  index_build(heap, ind, ILHead->il_info, false, false);
978 
979  index_close(ind, NoLock);
980  table_close(heap, NoLock);
981  }
982 }
struct _IndexList * il_next
Definition: bootstrap.c:172
Oid il_ind
Definition: bootstrap.c:170
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:167
static IndexList * ILHead
Definition: bootstrap.c:175
#define NoLock
Definition: lockdefs.h:34
IndexInfo * il_info
Definition: bootstrap.c:171
void index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isreindex, bool parallel)
Definition: index.c:2898
Oid il_heap
Definition: bootstrap.c:169
void index_close(Relation relation, LOCKMODE lockmode)
Definition: indexam.c:158
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39
Relation index_open(Oid relationId, LOCKMODE lockmode)
Definition: indexam.c:132

◆ CheckerModeMain()

static void CheckerModeMain ( void  )
static

Definition at line 185 of file bootstrap.c.

References proc_exit().

Referenced by BootstrapModeMain().

186 {
187  proc_exit(0);
188 }
void proc_exit(int code)
Definition: ipc.c:104

◆ cleanup()

◆ closerel()

void closerel ( char *  name)

Definition at line 467 of file bootstrap.c.

References DEBUG4, elog, ERROR, NoLock, RelationGetRelationName, and table_close().

Referenced by boot_openrel(), cleanup(), and DefineAttr().

468 {
469  if (name)
470  {
471  if (boot_reldesc)
472  {
473  if (strcmp(RelationGetRelationName(boot_reldesc), name) != 0)
474  elog(ERROR, "close of %s when %s was expected",
476  }
477  else
478  elog(ERROR, "close of %s before any relation was opened",
479  name);
480  }
481 
482  if (boot_reldesc == NULL)
483  elog(ERROR, "no open relation to close");
484  else
485  {
486  elog(DEBUG4, "close relation %s",
489  boot_reldesc = NULL;
490  }
491 }
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:167
Relation boot_reldesc
Definition: bootstrap.c:63
#define DEBUG4
Definition: elog.h:22
#define ERROR
Definition: elog.h:46
#define NoLock
Definition: lockdefs.h:34
#define RelationGetRelationName(relation)
Definition: rel.h:511
const char * name
Definition: encode.c:561
#define elog(elevel,...)
Definition: elog.h:232

◆ DefineAttr()

void DefineAttr ( char *  name,
char *  type,
int  attnum,
int  nullness 
)

Definition at line 504 of file bootstrap.c.

References typinfo::align, AllocateAttribute(), typmap::am_oid, typmap::am_typ, Assert, attlen, attname, attnotnull, attnum, ATTRIBUTE_FIXED_PART_SIZE, attrtypes, BOOTCOL_NULL_AUTO, BOOTCOL_NULL_FORCE_NOT_NULL, BOOTCOL_NULL_FORCE_NULL, typinfo::byval, closerel(), typinfo::collation, DEBUG4, typinfo::elem, elog, gettype(), i, InvalidCompressionMethod, InvalidOid, typinfo::len, MemSet, NameStr, namestrcpy(), NIL, typinfo::oid, OidIsValid, typinfo::storage, and WARNING.

505 {
506  Oid typeoid;
507 
508  if (boot_reldesc != NULL)
509  {
510  elog(WARNING, "no open relations allowed with CREATE command");
511  closerel(NULL);
512  }
513 
514  if (attrtypes[attnum] == NULL)
517 
519  elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
520  attrtypes[attnum]->attnum = attnum + 1;
521 
522  typeoid = gettype(type);
523 
524  if (Typ != NIL)
525  {
526  attrtypes[attnum]->atttypid = Ap->am_oid;
527  attrtypes[attnum]->attlen = Ap->am_typ.typlen;
528  attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
529  attrtypes[attnum]->attalign = Ap->am_typ.typalign;
530  attrtypes[attnum]->attstorage = Ap->am_typ.typstorage;
531  attrtypes[attnum]->attcompression = InvalidCompressionMethod;
532  attrtypes[attnum]->attcollation = Ap->am_typ.typcollation;
533  /* if an array type, assume 1-dimensional attribute */
534  if (Ap->am_typ.typelem != InvalidOid && Ap->am_typ.typlen < 0)
535  attrtypes[attnum]->attndims = 1;
536  else
537  attrtypes[attnum]->attndims = 0;
538  }
539  else
540  {
541  attrtypes[attnum]->atttypid = TypInfo[typeoid].oid;
542  attrtypes[attnum]->attlen = TypInfo[typeoid].len;
543  attrtypes[attnum]->attbyval = TypInfo[typeoid].byval;
544  attrtypes[attnum]->attalign = TypInfo[typeoid].align;
545  attrtypes[attnum]->attstorage = TypInfo[typeoid].storage;
546  attrtypes[attnum]->attcompression = InvalidCompressionMethod;
547  attrtypes[attnum]->attcollation = TypInfo[typeoid].collation;
548  /* if an array type, assume 1-dimensional attribute */
549  if (TypInfo[typeoid].elem != InvalidOid &&
550  attrtypes[attnum]->attlen < 0)
551  attrtypes[attnum]->attndims = 1;
552  else
553  attrtypes[attnum]->attndims = 0;
554  }
555 
556  /*
557  * If a system catalog column is collation-aware, force it to use C
558  * collation, so that its behavior is independent of the database's
559  * collation. This is essential to allow template0 to be cloned with a
560  * different database collation.
561  */
562  if (OidIsValid(attrtypes[attnum]->attcollation))
563  attrtypes[attnum]->attcollation = C_COLLATION_OID;
564 
565  attrtypes[attnum]->attstattarget = -1;
566  attrtypes[attnum]->attcacheoff = -1;
567  attrtypes[attnum]->atttypmod = -1;
568  attrtypes[attnum]->attislocal = true;
569 
570  if (nullness == BOOTCOL_NULL_FORCE_NOT_NULL)
571  {
572  attrtypes[attnum]->attnotnull = true;
573  }
574  else if (nullness == BOOTCOL_NULL_FORCE_NULL)
575  {
576  attrtypes[attnum]->attnotnull = false;
577  }
578  else
579  {
580  Assert(nullness == BOOTCOL_NULL_AUTO);
581 
582  /*
583  * Mark as "not null" if type is fixed-width and prior columns are
584  * likewise fixed-width and not-null. This corresponds to case where
585  * column can be accessed directly via C struct declaration.
586  */
587  if (attrtypes[attnum]->attlen > 0)
588  {
589  int i;
590 
591  /* check earlier attributes */
592  for (i = 0; i < attnum; i++)
593  {
594  if (attrtypes[i]->attlen <= 0 ||
595  !attrtypes[i]->attnotnull)
596  break;
597  }
598  if (i == attnum)
599  attrtypes[attnum]->attnotnull = true;
600  }
601  }
602 }
#define NIL
Definition: pg_list.h:65
#define BOOTCOL_NULL_FORCE_NULL
Definition: bootstrap.h:27
int16 len
Definition: bootstrap.c:83
bool attnotnull
Definition: pg_attribute.h:139
char align
Definition: bootstrap.c:85
void namestrcpy(Name name, const char *str)
Definition: name.c:233
Relation boot_reldesc
Definition: bootstrap.c:63
#define BOOTCOL_NULL_AUTO
Definition: bootstrap.h:26
#define MemSet(start, val, len)
Definition: c.h:1008
static List * Typ
Definition: bootstrap.c:153
unsigned int Oid
Definition: postgres_ext.h:31
void closerel(char *name)
Definition: bootstrap.c:467
static struct typmap * Ap
Definition: bootstrap.c:154
#define DEBUG4
Definition: elog.h:22
#define OidIsValid(objectId)
Definition: c.h:710
#define BOOTCOL_NULL_FORCE_NOT_NULL
Definition: bootstrap.h:28
NameData attname
Definition: pg_attribute.h:41
#define ATTRIBUTE_FIXED_PART_SIZE
Definition: pg_attribute.h:199
int16 attlen
Definition: pg_attribute.h:68
#define WARNING
Definition: elog.h:40
Oid collation
Definition: bootstrap.c:87
#define InvalidOid
Definition: postgres_ext.h:36
int16 attnum
Definition: pg_attribute.h:83
#define Assert(condition)
Definition: c.h:804
char storage
Definition: bootstrap.c:86
FormData_pg_type am_typ
Definition: bootstrap.c:150
static Form_pg_attribute AllocateAttribute(void)
Definition: bootstrap.c:898
static const struct typinfo TypInfo[]
Definition: bootstrap.c:92
const char * name
Definition: encode.c:561
bool byval
Definition: bootstrap.c:84
#define InvalidCompressionMethod
static Oid gettype(char *type)
Definition: bootstrap.c:750
Oid am_oid
Definition: bootstrap.c:149
#define elog(elevel,...)
Definition: elog.h:232
int i
#define NameStr(name)
Definition: c.h:681
Oid oid
Definition: bootstrap.c:81
Form_pg_attribute attrtypes[MAXATTR]
Definition: bootstrap.c:65

◆ gettype()

static Oid gettype ( char *  type)
static

Definition at line 750 of file bootstrap.c.

References typmap::am_oid, typmap::am_typ, DEBUG4, elog, ERROR, i, lfirst, list_free_deep(), n_types, typinfo::name, NAMEDATALEN, NameStr, NIL, and populate_typ_list().

Referenced by DefineAttr().

751 {
752  if (Typ != NIL)
753  {
754  ListCell *lc;
755 
756  foreach(lc, Typ)
757  {
758  struct typmap *app = lfirst(lc);
759 
760  if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
761  {
762  Ap = app;
763  return app->am_oid;
764  }
765  }
766 
767  /*
768  * The type wasn't known; reload the pg_type contents and check again
769  * to handle composite types, added since last populating the list.
770  */
771 
773  Typ = NIL;
775 
776  /*
777  * Calling gettype would result in infinite recursion for types
778  * missing in pg_type, so just repeat the lookup.
779  */
780  foreach(lc, Typ)
781  {
782  struct typmap *app = lfirst(lc);
783 
784  if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
785  {
786  Ap = app;
787  return app->am_oid;
788  }
789  }
790  }
791  else
792  {
793  int i;
794 
795  for (i = 0; i < n_types; i++)
796  {
797  if (strncmp(type, TypInfo[i].name, NAMEDATALEN) == 0)
798  return i;
799  }
800  /* Not in TypInfo, so we'd better be able to read pg_type now */
801  elog(DEBUG4, "external type: %s", type);
803  return gettype(type);
804  }
805  elog(ERROR, "unrecognized type \"%s\"", type);
806  /* not reached, here to make compiler happy */
807  return 0;
808 }
#define NIL
Definition: pg_list.h:65
static void populate_typ_list(void)
Definition: bootstrap.c:710
static List * Typ
Definition: bootstrap.c:153
static struct typmap * Ap
Definition: bootstrap.c:154
#define DEBUG4
Definition: elog.h:22
void list_free_deep(List *list)
Definition: list.c:1405
#define NAMEDATALEN
#define ERROR
Definition: elog.h:46
#define lfirst(lc)
Definition: pg_list.h:169
FormData_pg_type am_typ
Definition: bootstrap.c:150
static const int n_types
Definition: bootstrap.c:145
static const struct typinfo TypInfo[]
Definition: bootstrap.c:92
const char * name
Definition: encode.c:561
static Oid gettype(char *type)
Definition: bootstrap.c:750
Oid am_oid
Definition: bootstrap.c:149
#define elog(elevel,...)
Definition: elog.h:232
int i
#define NameStr(name)
Definition: c.h:681

◆ index_register()

void index_register ( Oid  heap,
Oid  ind,
IndexInfo indexInfo 
)

Definition at line 916 of file bootstrap.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, copyObject, IndexInfo::ii_ExclusionOps, IndexInfo::ii_ExclusionProcs, IndexInfo::ii_ExclusionStrats, IndexInfo::ii_Expressions, IndexInfo::ii_ExpressionsState, IndexInfo::ii_Predicate, IndexInfo::ii_PredicateState, _IndexList::il_heap, _IndexList::il_ind, _IndexList::il_info, _IndexList::il_next, ILHead, MemoryContextSwitchTo(), NIL, and palloc().

Referenced by index_create().

919 {
920  IndexList *newind;
921  MemoryContext oldcxt;
922 
923  /*
924  * XXX mao 10/31/92 -- don't gc index reldescs, associated info at
925  * bootstrap time. we'll declare the indexes now, but want to create them
926  * later.
927  */
928 
929  if (nogc == NULL)
931  "BootstrapNoGC",
933 
934  oldcxt = MemoryContextSwitchTo(nogc);
935 
936  newind = (IndexList *) palloc(sizeof(IndexList));
937  newind->il_heap = heap;
938  newind->il_ind = ind;
939  newind->il_info = (IndexInfo *) palloc(sizeof(IndexInfo));
940 
941  memcpy(newind->il_info, indexInfo, sizeof(IndexInfo));
942  /* expressions will likely be null, but may as well copy it */
943  newind->il_info->ii_Expressions =
944  copyObject(indexInfo->ii_Expressions);
945  newind->il_info->ii_ExpressionsState = NIL;
946  /* predicate will likely be null, but may as well copy it */
947  newind->il_info->ii_Predicate =
948  copyObject(indexInfo->ii_Predicate);
949  newind->il_info->ii_PredicateState = NULL;
950  /* no exclusion constraints at bootstrap time, so no need to copy */
951  Assert(indexInfo->ii_ExclusionOps == NULL);
952  Assert(indexInfo->ii_ExclusionProcs == NULL);
953  Assert(indexInfo->ii_ExclusionStrats == NULL);
954 
955  newind->il_next = ILHead;
956  ILHead = newind;
957 
958  MemoryContextSwitchTo(oldcxt);
959 }
struct _IndexList * il_next
Definition: bootstrap.c:172
#define NIL
Definition: pg_list.h:65
#define AllocSetContextCreate
Definition: memutils.h:173
Oid il_ind
Definition: bootstrap.c:170
List * ii_Predicate
Definition: execnodes.h:164
ExprState * ii_PredicateState
Definition: execnodes.h:165
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static IndexList * ILHead
Definition: bootstrap.c:175
Oid * ii_ExclusionProcs
Definition: execnodes.h:167
static MemoryContext nogc
Definition: bootstrap.c:159
List * ii_ExpressionsState
Definition: execnodes.h:163
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:195
IndexInfo * il_info
Definition: bootstrap.c:171
List * ii_Expressions
Definition: execnodes.h:162
#define Assert(condition)
Definition: c.h:804
Oid il_heap
Definition: bootstrap.c:169
Oid * ii_ExclusionOps
Definition: execnodes.h:166
void * palloc(Size size)
Definition: mcxt.c:1062
#define copyObject(obj)
Definition: nodes.h:654
uint16 * ii_ExclusionStrats
Definition: execnodes.h:168

◆ InsertOneNull()

void InsertOneNull ( int  i)

Definition at line 679 of file bootstrap.c.

References Assert, DEBUG4, elog, ERROR, i, MAXATTR, NameStr, PointerGetDatum, RelationData::rd_att, RelationGetRelationName, and TupleDescAttr.

680 {
681  elog(DEBUG4, "inserting column %d NULL", i);
682  Assert(i >= 0 && i < MAXATTR);
683  if (TupleDescAttr(boot_reldesc->rd_att, i)->attnotnull)
684  elog(ERROR,
685  "NULL value specified for not-null column \"%s\" of relation \"%s\"",
688  values[i] = PointerGetDatum(NULL);
689  Nulls[i] = true;
690 }
#define PointerGetDatum(X)
Definition: postgres.h:600
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
Relation boot_reldesc
Definition: bootstrap.c:63
#define DEBUG4
Definition: elog.h:22
#define ERROR
Definition: elog.h:46
#define RelationGetRelationName(relation)
Definition: rel.h:511
#define MAXATTR
Definition: bootstrap.h:24
TupleDesc rd_att
Definition: rel.h:110
#define Assert(condition)
Definition: c.h:804
static Datum values[MAXATTR]
Definition: bootstrap.c:156
#define elog(elevel,...)
Definition: elog.h:232
int i
#define NameStr(name)
Definition: c.h:681
static bool Nulls[MAXATTR]
Definition: bootstrap.c:157

◆ InsertOneTuple()

void InsertOneTuple ( void  )

Definition at line 613 of file bootstrap.c.

References attrtypes, CreateTupleDesc(), DEBUG4, elog, heap_form_tuple(), heap_freetuple(), i, numattr, pfree(), and simple_heap_insert().

614 {
615  HeapTuple tuple;
616  TupleDesc tupDesc;
617  int i;
618 
619  elog(DEBUG4, "inserting row with %d columns", numattr);
620 
621  tupDesc = CreateTupleDesc(numattr, attrtypes);
622  tuple = heap_form_tuple(tupDesc, values, Nulls);
623  pfree(tupDesc); /* just free's tupDesc, not the attrtypes */
624 
626  heap_freetuple(tuple);
627  elog(DEBUG4, "row inserted");
628 
629  /*
630  * Reset null markers for next tuple
631  */
632  for (i = 0; i < numattr; i++)
633  Nulls[i] = false;
634 }
int numattr
Definition: bootstrap.c:66
Relation boot_reldesc
Definition: bootstrap.c:63
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, bool *isnull)
Definition: heaptuple.c:1020
void heap_freetuple(HeapTuple htup)
Definition: heaptuple.c:1338
#define DEBUG4
Definition: elog.h:22
void pfree(void *pointer)
Definition: mcxt.c:1169
void simple_heap_insert(Relation relation, HeapTuple tup)
Definition: heapam.c:2642
static Datum values[MAXATTR]
Definition: bootstrap.c:156
#define elog(elevel,...)
Definition: elog.h:232
int i
TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs)
Definition: tupdesc.c:90
static bool Nulls[MAXATTR]
Definition: bootstrap.c:157
Form_pg_attribute attrtypes[MAXATTR]
Definition: bootstrap.c:65

◆ InsertOneValue()

void InsertOneValue ( char *  value,
int  i 
)

Definition at line 641 of file bootstrap.c.

References AssertArg, boot_get_type_io_data(), DEBUG4, elog, ereport, errmsg_internal(), i, MAXATTR, OidInputFunctionCall(), OidOutputFunctionCall(), RelationData::rd_att, TupleDescAttr, and typalign.

642 {
643  Oid typoid;
644  int16 typlen;
645  bool typbyval;
646  char typalign;
647  char typdelim;
648  Oid typioparam;
649  Oid typinput;
650  Oid typoutput;
651 
652  AssertArg(i >= 0 && i < MAXATTR);
653 
654  elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
655 
656  typoid = TupleDescAttr(boot_reldesc->rd_att, i)->atttypid;
657 
658  boot_get_type_io_data(typoid,
659  &typlen, &typbyval, &typalign,
660  &typdelim, &typioparam,
661  &typinput, &typoutput);
662 
663  values[i] = OidInputFunctionCall(typinput, value, typioparam, -1);
664 
665  /*
666  * We use ereport not elog here so that parameters aren't evaluated unless
667  * the message is going to be printed, which generally it isn't
668  */
669  ereport(DEBUG4,
670  (errmsg_internal("inserted -> %s",
671  OidOutputFunctionCall(typoutput, values[i]))));
672 }
signed short int16
Definition: c.h:428
#define TupleDescAttr(tupdesc, i)
Definition: tupdesc.h:92
Relation boot_reldesc
Definition: bootstrap.c:63
unsigned int Oid
Definition: postgres_ext.h:31
#define DEBUG4
Definition: elog.h:22
char typalign
Definition: pg_type.h:176
#define MAXATTR
Definition: bootstrap.h:24
#define AssertArg(condition)
Definition: c.h:806
TupleDesc rd_att
Definition: rel.h:110
static struct @143 value
#define ereport(elevel,...)
Definition: elog.h:157
int errmsg_internal(const char *fmt,...)
Definition: elog.c:996
static Datum values[MAXATTR]
Definition: bootstrap.c:156
char * OidOutputFunctionCall(Oid functionId, Datum val)
Definition: fmgr.c:1653
#define elog(elevel,...)
Definition: elog.h:232
int i
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
Definition: fmgr.c:1644
void boot_get_type_io_data(Oid typid, int16 *typlen, bool *typbyval, char *typalign, char *typdelim, Oid *typioparam, Oid *typinput, Oid *typoutput)
Definition: bootstrap.c:821

◆ populate_typ_list()

static void populate_typ_list ( void  )
static

Definition at line 710 of file bootstrap.c.

References typmap::am_oid, typmap::am_typ, Assert, ForwardScanDirection, GETSTRUCT, heap_getnext(), lappend(), MemoryContextSwitchTo(), NIL, NoLock, palloc(), table_beginscan_catalog(), table_close(), table_endscan(), table_open(), and TopMemoryContext.

Referenced by boot_openrel(), and gettype().

711 {
712  Relation rel;
713  TableScanDesc scan;
714  HeapTuple tup;
715  MemoryContext old;
716 
717  Assert(Typ == NIL);
718 
719  rel = table_open(TypeRelationId, NoLock);
720  scan = table_beginscan_catalog(rel, 0, NULL);
722  while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
723  {
724  Form_pg_type typForm = (Form_pg_type) GETSTRUCT(tup);
725  struct typmap *newtyp;
726 
727  newtyp = (struct typmap *) palloc(sizeof(struct typmap));
728  Typ = lappend(Typ, newtyp);
729 
730  newtyp->am_oid = typForm->oid;
731  memcpy(&newtyp->am_typ, typForm, sizeof(newtyp->am_typ));
732  }
734  table_endscan(scan);
735  table_close(rel, NoLock);
736 }
#define NIL
Definition: pg_list.h:65
void table_close(Relation relation, LOCKMODE lockmode)
Definition: table.c:167
#define GETSTRUCT(TUP)
Definition: htup_details.h:654
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, struct ScanKeyData *key)
Definition: tableam.c:112
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static List * Typ
Definition: bootstrap.c:153
#define NoLock
Definition: lockdefs.h:34
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
Definition: heapam.c:1340
MemoryContext TopMemoryContext
Definition: mcxt.c:48
List * lappend(List *list, void *datum)
Definition: list.c:336
#define Assert(condition)
Definition: c.h:804
FormData_pg_type am_typ
Definition: bootstrap.c:150
FormData_pg_type * Form_pg_type
Definition: pg_type.h:261
static void table_endscan(TableScanDesc scan)
Definition: tableam.h:991
Oid am_oid
Definition: bootstrap.c:149
void * palloc(Size size)
Definition: mcxt.c:1062
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition: table.c:39

Variable Documentation

◆ Ap

struct typmap* Ap = NULL
static

Definition at line 154 of file bootstrap.c.

◆ attrtypes

Definition at line 65 of file bootstrap.c.

Referenced by boot_openrel(), BootstrapModeMain(), DefineAttr(), and InsertOneTuple().

◆ boot_reldesc

Relation boot_reldesc

Definition at line 63 of file bootstrap.c.

◆ bootstrap_data_checksum_version

uint32 bootstrap_data_checksum_version = 0

Definition at line 48 of file bootstrap.c.

Referenced by BootstrapModeMain(), and InitControlFile().

◆ ILHead

IndexList* ILHead = NULL
static

Definition at line 175 of file bootstrap.c.

Referenced by index_register().

◆ n_types

const int n_types = sizeof(TypInfo) / sizeof(struct typinfo)
static

Definition at line 145 of file bootstrap.c.

Referenced by boot_get_type_io_data(), and gettype().

◆ nogc

MemoryContext nogc = NULL
static

Definition at line 159 of file bootstrap.c.

◆ Nulls

bool Nulls[MAXATTR]
static

Definition at line 157 of file bootstrap.c.

◆ numattr

int numattr

Definition at line 66 of file bootstrap.c.

Referenced by boot_openrel(), InsertOneTuple(), and tsvector_update_trigger().

◆ Typ

List* Typ = NIL
static

Definition at line 153 of file bootstrap.c.

◆ TypInfo

const struct typinfo TypInfo[]
static

Definition at line 92 of file bootstrap.c.

◆ values

Datum values[MAXATTR]
static

Definition at line 156 of file bootstrap.c.

Referenced by _bt_check_unique(), aclexplode(), AddEnumLabel(), AddSubscriptionRelState(), AggregateCreate(), AlterCollation(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterOperator(), AlterPolicy(), AlterPublicationOptions(), AlterSetting(), AlterSubscription(), AlterTypeRecurse(), apply_returning_filter(), ApplyExtensionUpdates(), array_iterate(), array_map(), array_out(), array_replace_internal(), brin_deform_tuple(), brin_form_tuple(), brin_metapage_info(), brin_page_items(), bt_metap(), bt_page_print_tuples(), bt_page_stats_internal(), build_pgstattuple_type(), build_sorted_items(), build_tuplestore_recursively(), CastCreate(), CatalogIndexInsert(), CollationCreate(), collectTSQueryValues(), comparetup_index_btree(), compute_index_stats(), compute_scalar_stats(), connect_pg_server(), connectDatabase(), ConnectDatabase(), ConversionCreate(), copy_replication_slot(), create_cursor(), CreateAccessMethod(), CreateComments(), CreateConstraintEntry(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateOpFamily(), CreatePolicy(), CreateProceduralLanguage(), CreatePublication(), CreateReplicationSlot(), CreateSharedComments(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTriggerFiringOn(), CreateUserMapping(), crosstab(), dblink_get_pkey(), DefineOpClass(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), deflist_to_tuplestore(), DiscreteKnapsack(), do_connect(), do_text_output_multiline(), doConnect(), each_object_field_end(), each_worker_jsonb(), elements_array_element_end(), elements_worker_jsonb(), EnumValuesCreate(), exec_move_row(), exec_rt_fetch(), ExecBuildAggTrans(), ExecCheckIndexConstraints(), ExecComputeStoredGenerated(), ExecEvalMinMax(), ExecEvalXmlExpr(), ExecFilterJunk(), ExecFindPartition(), ExecGrant_Attribute(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Largeobject(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecInitExprRec(), ExecInsertIndexTuples(), execute_dml_stmt(), ExtractReplicaIdentity(), file_acquire_sample_rows(), fill_hba_line(), fillRelOptions(), get_actual_variable_endpoint(), get_available_versions_for_extension(), get_crosstab_tuplestore(), get_text_array_contents(), GetConnection(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), gist_page_items(), gist_page_items_bytea(), gist_page_opaque_info(), hash_bitmap_info(), hash_metapage_info(), hash_page_items(), hash_page_stats(), hash_record(), hash_record_extended(), heap_deform_tuple(), heap_modify_tuple(), heap_modify_tuple_by_cols(), heap_page_items(), heap_tuple_infomask_flags(), heapam_index_build_range_scan(), heapam_index_validate_scan(), heapam_relation_copy_for_cluster(), hstore_from_record(), hstore_populate_record(), IdentifySystem(), index_concurrently_swap(), index_truncate_tuple(), IndexCheckExclusion(), insert_event_trigger_tuple(), InsertExtensionTuple(), InsertPgClassTuple(), InsertRule(), intset_flush_buffered_values(), inv_truncate(), inv_write(), LargeObjectCreate(), LogicalOutputWrite(), logicalrep_write_tuple(), main(), make_tuple_from_result_row(), make_tuple_indirect(), MakeConfigurationMapping(), MakeOldSnapshotTimeMappingTuple(), materializeResult(), NamespaceCreate(), ndistinct_for_combination(), oid_array_to_list(), OperatorCreate(), OperatorShellMake(), page_header(), parse_key_value_arrays(), parseLocalRelOptions(), perform_pruning_base_step(), pg_armor(), pg_available_extensions(), pg_buffercache_pages(), pg_config(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), pg_create_logical_replication_slot(), pg_create_physical_replication_slot(), pg_cursor(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_extension_update_paths(), pg_get_catalog_foreign_keys(), pg_get_keywords(), pg_get_multixact_members(), pg_get_object_address(), pg_get_replication_slots(), pg_get_shmem_allocations(), pg_identify_object(), pg_identify_object_as_address(), pg_last_committed_xact(), pg_lock_status(), pg_logdir_ls_internal(), pg_ls_dir(), pg_ls_dir_files(), pg_partition_tree(), pg_prepared_statement(), pg_prepared_xact(), pg_replication_slot_advance(), pg_sequence_parameters(), pg_show_replication_origin_status(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_archiver(), pg_stat_get_progress_info(), pg_stat_get_replication_slot(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_wal(), pg_stat_get_wal_receiver(), pg_stat_get_wal_senders(), pg_stat_statements_info(), pg_stat_statements_internal(), pg_stats_ext_mcvlist_items(), pg_stop_backup_v2(), pg_tablespace_databases(), pg_timezone_abbrevs(), pg_timezone_names(), pg_visibility(), pg_visibility_map(), pg_visibility_map_rel(), pg_visibility_map_summary(), pg_visibility_rel(), pg_walfile_name_offset(), pg_xact_commit_timestamp_origin(), pgp_armor_headers(), pgrowlocks(), pgstatginindex_internal(), pgstathashindex(), pgstatindex_impl(), pgstattuple_approx_internal(), plperl_build_tuple_result(), pltcl_build_tuple_result(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLySequence_ToComposite(), populate_record(), postgres_fdw_get_connections(), pqPacketSend(), ProcedureCreate(), prs_process_call(), publication_add_relation(), publication_add_schema(), PutMemoryContextsStatsTupleStore(), RangeCreate(), ReadReplicationSlot(), record_in(), record_out(), record_recv(), record_send(), recordExtensionInitPrivWorker(), reduce_expanded_ranges(), RemoveRoleFromObjectPolicy(), replorigin_create(), report_corruption_internal(), serialize_expr_stats(), SetDefaultACL(), SetSecurityLabel(), SetSharedSecurityLabel(), shdepAddDependency(), shdepChangeDep(), show_all_file_settings(), show_all_settings(), ShowAllGUCConfig(), slot_deform_heap_tuple(), split_text_accum_result(), sql_conn(), ssl_extension_info(), StartReplication(), statext_mcv_serialize(), statext_store(), StoreAttrDefault(), storeOperators(), StorePartitionKey(), storeProcedures(), StoreSingleInheritance(), test_enc_conversion(), test_huge_distances(), test_predtest(), tfuncLoadRows(), ts_process_call(), tsvector_unnest(), tt_process_call(), TypeCreate(), TypeShellMake(), unique_key_recheck(), update_attstats(), UpdateIndexRelation(), UpdateSubscriptionRelState(), UpdateTwoPhaseState(), vacuumlo(), ValuesNext(), WaitForLockersMultiple(), and xpath_table().