PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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 "bootstrap/bootstrap.h"
#include "catalog/index.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_type.h"
#include "common/link-canary.h"
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "pg_getopt.h"
#include "postmaster/postmaster.h"
#include "storage/bufpage.h"
#include "storage/ipc.h"
#include "storage/proc.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/guc.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 InsertOneProargdefaultsValue (char *value)
 
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 *relname)
 
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, Oid *typcollation)
 
void index_register (Oid heap, Oid ind, const IndexInfo *indexInfo)
 
void build_indices (void)
 

Variables

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

Function Documentation

◆ AllocateAttribute()

static Form_pg_attribute AllocateAttribute ( void  )
static

Definition at line 1045 of file bootstrap.c.

1046{
1047 return (Form_pg_attribute)
1049}
void * MemoryContextAllocZero(MemoryContext context, Size size)
Definition mcxt.c:1266
MemoryContext TopMemoryContext
Definition mcxt.c:166
#define ATTRIBUTE_FIXED_PART_SIZE
FormData_pg_attribute * Form_pg_attribute

References ATTRIBUTE_FIXED_PART_SIZE, MemoryContextAllocZero(), and TopMemoryContext.

Referenced by boot_openrel(), and DefineAttr().

◆ 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,
Oid typcollation 
)

Definition at line 963 of file bootstrap.c.

972{
973 if (Typ != NIL)
974 {
975 /* We have the boot-time contents of pg_type, so use it */
976 struct typmap *ap = NULL;
977 ListCell *lc;
978
979 foreach(lc, Typ)
980 {
981 ap = lfirst(lc);
982 if (ap->am_oid == typid)
983 break;
984 }
985
986 if (!ap || ap->am_oid != typid)
987 elog(ERROR, "type OID %u not found in Typ list", typid);
988
989 *typlen = ap->am_typ.typlen;
990 *typbyval = ap->am_typ.typbyval;
991 *typalign = ap->am_typ.typalign;
992 *typdelim = ap->am_typ.typdelim;
993
994 /* XXX this logic must match getTypeIOParam() */
995 if (OidIsValid(ap->am_typ.typelem))
996 *typioparam = ap->am_typ.typelem;
997 else
998 *typioparam = typid;
999
1000 *typinput = ap->am_typ.typinput;
1001 *typoutput = ap->am_typ.typoutput;
1002
1003 *typcollation = ap->am_typ.typcollation;
1004 }
1005 else
1006 {
1007 /* We don't have pg_type yet, so use the hard-wired TypInfo array */
1008 int typeindex;
1009
1010 for (typeindex = 0; typeindex < n_types; typeindex++)
1011 {
1012 if (TypInfo[typeindex].oid == typid)
1013 break;
1014 }
1015 if (typeindex >= n_types)
1016 elog(ERROR, "type OID %u not found in TypInfo", typid);
1017
1018 *typlen = TypInfo[typeindex].len;
1019 *typbyval = TypInfo[typeindex].byval;
1021 /* We assume typdelim is ',' for all boot-time types */
1022 *typdelim = ',';
1023
1024 /* XXX this logic must match getTypeIOParam() */
1025 if (OidIsValid(TypInfo[typeindex].elem))
1026 *typioparam = TypInfo[typeindex].elem;
1027 else
1028 *typioparam = typid;
1029
1031 *typoutput = TypInfo[typeindex].outproc;
1032
1033 *typcollation = TypInfo[typeindex].collation;
1034 }
1035}
static const int n_types
Definition bootstrap.c:136
static const struct typinfo TypInfo[]
Definition bootstrap.c:89
static List * Typ
Definition bootstrap.c:144
#define OidIsValid(objectId)
Definition c.h:821
#define ERROR
Definition elog.h:39
#define elog(elevel,...)
Definition elog.h:226
#define lfirst(lc)
Definition pg_list.h:172
#define NIL
Definition pg_list.h:68
char typalign
Definition pg_type.h:178
static int fb(int x)
char align
Definition bootstrap.c:82
Oid outproc
Definition bootstrap.c:86
int16 len
Definition bootstrap.c:80
bool byval
Definition bootstrap.c:81
Oid collation
Definition bootstrap.c:84
Oid elem
Definition bootstrap.c:79
Oid inproc
Definition bootstrap.c:85

References typinfo::align, typinfo::byval, typinfo::collation, typinfo::elem, elog, ERROR, fb(), typinfo::inproc, typinfo::len, lfirst, n_types, NIL, OidIsValid, typinfo::outproc, Typ, typalign, and TypInfo.

Referenced by get_type_io_data(), InsertOneProargdefaultsValue(), and InsertOneValue().

◆ boot_openrel()

void boot_openrel ( char relname)

Definition at line 436 of file bootstrap.c.

437{
438 int i;
439
440 if (strlen(relname) >= NAMEDATALEN)
441 relname[NAMEDATALEN - 1] = '\0';
442
443 /*
444 * pg_type must be filled before any OPEN command is executed, hence we
445 * can now populate Typ if we haven't yet.
446 */
447 if (Typ == NIL)
449
450 if (boot_reldesc != NULL)
451 closerel(NULL);
452
453 elog(DEBUG4, "open relation %s, attrsize %d",
455
458 for (i = 0; i < numattr; i++)
459 {
460 if (attrtypes[i] == NULL)
465
466 {
468
469 elog(DEBUG4, "create attribute %d name %s len %d num %d type %u",
470 i, NameStr(at->attname), at->attlen, at->attnum,
471 at->atttypid);
472 }
473 }
474}
void closerel(char *relname)
Definition bootstrap.c:481
static void populate_typ_list(void)
Definition bootstrap.c:851
Relation boot_reldesc
Definition bootstrap.c:60
Form_pg_attribute attrtypes[MAXATTR]
Definition bootstrap.c:62
int numattr
Definition bootstrap.c:63
static Form_pg_attribute AllocateAttribute(void)
Definition bootstrap.c:1045
#define NameStr(name)
Definition c.h:798
#define DEBUG4
Definition elog.h:27
int i
Definition isn.c:77
#define NoLock
Definition lockdefs.h:34
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
Definition makefuncs.c:473
NameData relname
Definition pg_class.h:40
#define NAMEDATALEN
#define RelationGetNumberOfAttributes(relation)
Definition rel.h:520
TupleDesc rd_att
Definition rel.h:112
Relation table_openrv(const RangeVar *relation, LOCKMODE lockmode)
Definition table.c:83
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
Definition tupdesc.h:160

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

◆ bootstrap_signals()

static void bootstrap_signals ( void  )
static

Definition at line 409 of file bootstrap.c.

410{
412
413 /*
414 * We don't actually need any non-default signal handling in bootstrap
415 * mode; "curl up and die" is a sufficient response for all these cases.
416 * Let's set that handling explicitly, as documentation if nothing else.
417 */
422}
#define Assert(condition)
Definition c.h:906
bool IsUnderPostmaster
Definition globals.c:120
#define pqsignal
Definition port.h:547
#define SIGHUP
Definition win32_port.h:158
#define SIGQUIT
Definition win32_port.h:159

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

Referenced by BootstrapModeMain().

◆ BootstrapModeMain()

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

Definition at line 194 of file bootstrap.c.

195{
196 int i;
197 char *progname = argv[0];
198 int flag;
199 char *userDoption = NULL;
200 uint32 bootstrap_data_checksum_version = 0; /* No checksum */
201 yyscan_t scanner;
202
204
205 InitStandaloneProcess(argv[0]);
206
207 /* Set defaults, to be overridden by explicit options below */
209
210 /* an initial --boot or --check should be present */
211 Assert(argc > 1
212 && (strcmp(argv[1], "--boot") == 0
213 || strcmp(argv[1], "--check") == 0));
214 argv++;
215 argc--;
216
217 while ((flag = getopt(argc, argv, "B:c:d:D:Fkr:X:-:")) != -1)
218 {
219 switch (flag)
220 {
221 case 'B':
222 SetConfigOption("shared_buffers", optarg, PGC_POSTMASTER, PGC_S_ARGV);
223 break;
224 case '-':
225
226 /*
227 * Error if the user misplaced a special must-be-first option
228 * for dispatching to a subprogram. parse_dispatch_option()
229 * returns DISPATCH_POSTMASTER if it doesn't find a match, so
230 * error for anything else.
231 */
235 errmsg("--%s must be first argument", optarg)));
236
238 case 'c':
239 {
240 char *name,
241 *value;
242
244 if (!value)
245 {
246 if (flag == '-')
249 errmsg("--%s requires a value",
250 optarg)));
251 else
254 errmsg("-c %s requires a value",
255 optarg)));
256 }
257
259 pfree(name);
260 pfree(value);
261 break;
262 }
263 case 'D':
265 break;
266 case 'd':
267 {
268 /* Turn on debugging for the bootstrap process. */
269 char *debugstr;
270
271 debugstr = psprintf("debug%s", optarg);
272 SetConfigOption("log_min_messages", debugstr,
274 SetConfigOption("client_min_messages", debugstr,
277 }
278 break;
279 case 'F':
280 SetConfigOption("fsync", "false", PGC_POSTMASTER, PGC_S_ARGV);
281 break;
282 case 'k':
284 break;
285 case 'r':
287 break;
288 case 'X':
290 break;
291 default:
292 write_stderr("Try \"%s --help\" for more information.\n",
293 progname);
294 proc_exit(1);
295 break;
296 }
297 }
298
299 if (argc != optind)
300 {
301 write_stderr("%s: invalid command-line arguments\n", progname);
302 proc_exit(1);
303 }
304
305 /* Acquire configuration parameters */
307 proc_exit(1);
308
309 /*
310 * Validate we have been given a reasonable-looking DataDir and change
311 * into it
312 */
313 checkDataDir();
315
317
319 IgnoreSystemIndexes = true;
320
322
323 /*
324 * Even though bootstrapping runs in single-process mode, initialize
325 * postmaster child slots array so that --check can detect running out of
326 * shared memory or other resources if max_connections is set too high.
327 */
329
331
333
334 /*
335 * Estimate number of openable files. This is essential too in --check
336 * mode, because on some platforms semaphores count as open files.
337 */
339
340 /*
341 * XXX: It might make sense to move this into its own function at some
342 * point. Right now it seems like it'd cause more code duplication than
343 * it's worth.
344 */
345 if (check_only)
346 {
349 abort();
350 }
351
352 /*
353 * Do backend-like initialization for bootstrap mode
354 */
355 InitProcess();
356
357 BaseInit();
358
361
362 /*
363 * To ensure that src/common/link-canary.c is linked into the backend, we
364 * must call it from somewhere. Here is as good as anywhere.
365 */
367 elog(ERROR, "backend is incorrectly linked to frontend functions");
368
370
371 /* Initialize stuff for bootstrap-file processing */
372 for (i = 0; i < MAXATTR; i++)
373 {
374 attrtypes[i] = NULL;
375 Nulls[i] = false;
376 }
377
378 if (boot_yylex_init(&scanner) != 0)
379 elog(ERROR, "yylex_init() failed: %m");
380
381 /*
382 * Process bootstrap input.
383 */
385 boot_yyparse(scanner);
387
388 /*
389 * We should now know about all mapped relations, so it's okay to write
390 * out the initial relation mapping files.
391 */
393
394 /* Clean up and exit */
395 cleanup();
396 proc_exit(0);
397}
#define write_stderr(str)
Definition parallel.c:186
static void CheckerModeMain(void)
Definition bootstrap.c:176
static void cleanup(void)
Definition bootstrap.c:838
static void bootstrap_signals(void)
Definition bootstrap.c:409
static bool Nulls[MAXATTR]
Definition bootstrap.c:148
int boot_yylex_init(yyscan_t *yyscannerp)
#define MAXATTR
Definition bootstrap.h:25
int boot_yyparse(yyscan_t yyscanner)
#define PG_DATA_CHECKSUM_VERSION
Definition bufpage.h:206
uint32_t uint32
Definition c.h:579
#define pg_fallthrough
Definition c.h:144
void * yyscan_t
Definition cubedata.h:65
int errcode(int sqlerrcode)
Definition elog.c:874
int errmsg(const char *fmt,...)
Definition elog.c:1093
#define ereport(elevel,...)
Definition elog.h:150
void set_max_safe_fds(void)
Definition fd.c:1044
char OutputFileName[MAXPGPATH]
Definition globals.c:79
void SetConfigOption(const char *name, const char *value, GucContext context, GucSource source)
Definition guc.c:4196
bool SelectConfigFiles(const char *userDoption, const char *progname)
Definition guc.c:1655
void ParseLongOption(const char *string, char **name, char **value)
Definition guc.c:6205
void InitializeGUCOptions(void)
Definition guc.c:1407
@ PGC_S_DYNAMIC_DEFAULT
Definition guc.h:114
@ PGC_S_ARGV
Definition guc.h:117
@ PGC_INTERNAL
Definition guc.h:73
@ PGC_POSTMASTER
Definition guc.h:74
static struct @174 value
void proc_exit(int code)
Definition ipc.c:105
void CreateSharedMemoryAndSemaphores(void)
Definition ipci.c:191
DispatchOption parse_dispatch_option(const char *name)
Definition main.c:244
const char * progname
Definition main.c:44
char * pstrdup(const char *in)
Definition mcxt.c:1781
void pfree(void *pointer)
Definition mcxt.c:1616
@ NormalProcessing
Definition miscadmin.h:472
@ BootstrapProcessing
Definition miscadmin.h:470
#define SetProcessingMode(mode)
Definition miscadmin.h:483
void ChangeToDataDir(void)
Definition miscinit.c:409
void InitStandaloneProcess(const char *argv0)
Definition miscinit.c:175
bool IgnoreSystemIndexes
Definition miscinit.c:81
void checkDataDir(void)
Definition miscinit.c:296
void CreateDataDirLockFile(bool amPostmaster)
Definition miscinit.c:1463
#define MAXPGPATH
PGDLLIMPORT int optind
Definition getopt.c:51
int getopt(int nargc, char *const *nargv, const char *ostr)
Definition getopt.c:72
PGDLLIMPORT char * optarg
Definition getopt.c:53
void InitPostmasterChildSlots(void)
Definition pmchild.c:97
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition strlcpy.c:45
static const char * userDoption
Definition postgres.c:155
#define InvalidOid
void InitializeMaxBackends(void)
Definition postinit.c:558
void BaseInit(void)
Definition postinit.c:615
void InitializeFastPathLocks(void)
Definition postinit.c:583
void InitPostgres(const char *in_dbname, Oid dboid, const char *username, Oid useroid, bits32 flags, char *out_dbname)
Definition postinit.c:718
@ DISPATCH_POSTMASTER
Definition postmaster.h:139
char * psprintf(const char *fmt,...)
Definition psprintf.c:43
void RelationMapFinishBootstrap(void)
Definition relmapper.c:625
void InitProcess(void)
Definition proc.c:379
char * flag(int b)
Definition test-ctype.c:33
const char * name
void StartTransactionCommand(void)
Definition xact.c:3080
void CommitTransactionCommand(void)
Definition xact.c:3178
void BootStrapXLOG(uint32 data_checksum_version)
Definition xlog.c:5109

References Assert, attrtypes, BaseInit(), boot_yylex_init(), boot_yyparse(), bootstrap_signals(), BootstrapProcessing, BootStrapXLOG(), ChangeToDataDir(), checkDataDir(), CheckerModeMain(), cleanup(), CommitTransactionCommand(), CreateDataDirLockFile(), CreateSharedMemoryAndSemaphores(), DISPATCH_POSTMASTER, elog, ereport, errcode(), errmsg(), ERROR, fb(), flag(), getopt(), i, IgnoreSystemIndexes, InitializeFastPathLocks(), InitializeGUCOptions(), InitializeMaxBackends(), InitPostgres(), InitPostmasterChildSlots(), InitProcess(), InitStandaloneProcess(), InvalidOid, IsUnderPostmaster, MAXATTR, MAXPGPATH, name, NormalProcessing, Nulls, optarg, optind, OutputFileName, parse_dispatch_option(), ParseLongOption(), pfree(), PG_DATA_CHECKSUM_VERSION, pg_fallthrough, pg_link_canary_is_frontend(), PGC_INTERNAL, PGC_POSTMASTER, PGC_S_ARGV, PGC_S_DYNAMIC_DEFAULT, proc_exit(), progname, psprintf(), pstrdup(), RelationMapFinishBootstrap(), SelectConfigFiles(), set_max_safe_fds(), SetConfigOption(), SetProcessingMode, StartTransactionCommand(), strlcpy(), userDoption, value, and write_stderr.

Referenced by main().

◆ build_indices()

void build_indices ( void  )

Definition at line 1113 of file bootstrap.c.

1114{
1115 for (; ILHead != NULL; ILHead = ILHead->il_next)
1116 {
1117 Relation heap;
1118 Relation ind;
1119
1120 /* need not bother with locks during bootstrap */
1121 heap = table_open(ILHead->il_heap, NoLock);
1123
1124 index_build(heap, ind, ILHead->il_info, false, false);
1125
1127 table_close(heap, NoLock);
1128 }
1129}
static IndexList * ILHead
Definition bootstrap.c:166
void index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isreindex, bool parallel)
Definition index.c:3000
void index_close(Relation relation, LOCKMODE lockmode)
Definition indexam.c:177
Relation index_open(Oid relationId, LOCKMODE lockmode)
Definition indexam.c:133
struct _IndexList * il_next
Definition bootstrap.c:163
IndexInfo * il_info
Definition bootstrap.c:162
void table_close(Relation relation, LOCKMODE lockmode)
Definition table.c:126
Relation table_open(Oid relationId, LOCKMODE lockmode)
Definition table.c:40

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

◆ CheckerModeMain()

static void CheckerModeMain ( void  )
static

Definition at line 176 of file bootstrap.c.

177{
178 proc_exit(0);
179}

References proc_exit().

Referenced by BootstrapModeMain().

◆ cleanup()

◆ closerel()

void closerel ( char relname)

Definition at line 481 of file bootstrap.c.

482{
483 if (relname)
484 {
485 if (boot_reldesc)
486 {
488 elog(ERROR, "close of %s when %s was expected",
490 }
491 else
492 elog(ERROR, "close of %s before any relation was opened",
493 relname);
494 }
495
496 if (boot_reldesc == NULL)
497 elog(ERROR, "no open relation to close");
498 else
499 {
500 elog(DEBUG4, "close relation %s",
504 }
505}
#define RelationGetRelationName(relation)
Definition rel.h:548

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

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

◆ DefineAttr()

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

Definition at line 518 of file bootstrap.c.

519{
520 Oid typeoid;
521
522 if (boot_reldesc != NULL)
523 {
524 elog(WARNING, "no open relations allowed with CREATE command");
525 closerel(NULL);
526 }
527
528 if (attrtypes[attnum] == NULL)
531
533 elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type);
534 attrtypes[attnum]->attnum = attnum + 1;
535
536 typeoid = gettype(type);
537
538 if (Typ != NIL)
539 {
540 attrtypes[attnum]->atttypid = Ap->am_oid;
541 attrtypes[attnum]->attlen = Ap->am_typ.typlen;
542 attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
543 attrtypes[attnum]->attalign = Ap->am_typ.typalign;
544 attrtypes[attnum]->attstorage = Ap->am_typ.typstorage;
545 attrtypes[attnum]->attcompression = InvalidCompressionMethod;
546 attrtypes[attnum]->attcollation = Ap->am_typ.typcollation;
547 /* if an array type, assume 1-dimensional attribute */
548 if (Ap->am_typ.typelem != InvalidOid && Ap->am_typ.typlen < 0)
549 attrtypes[attnum]->attndims = 1;
550 else
551 attrtypes[attnum]->attndims = 0;
552 }
553 else
554 {
555 attrtypes[attnum]->atttypid = TypInfo[typeoid].oid;
556 attrtypes[attnum]->attlen = TypInfo[typeoid].len;
557 attrtypes[attnum]->attbyval = TypInfo[typeoid].byval;
558 attrtypes[attnum]->attalign = TypInfo[typeoid].align;
559 attrtypes[attnum]->attstorage = TypInfo[typeoid].storage;
560 attrtypes[attnum]->attcompression = InvalidCompressionMethod;
561 attrtypes[attnum]->attcollation = TypInfo[typeoid].collation;
562 /* if an array type, assume 1-dimensional attribute */
563 if (TypInfo[typeoid].elem != InvalidOid &&
564 attrtypes[attnum]->attlen < 0)
565 attrtypes[attnum]->attndims = 1;
566 else
567 attrtypes[attnum]->attndims = 0;
568 }
569
570 /*
571 * If a system catalog column is collation-aware, force it to use C
572 * collation, so that its behavior is independent of the database's
573 * collation. This is essential to allow template0 to be cloned with a
574 * different database collation.
575 */
576 if (OidIsValid(attrtypes[attnum]->attcollation))
577 attrtypes[attnum]->attcollation = C_COLLATION_OID;
578
579 attrtypes[attnum]->atttypmod = -1;
580 attrtypes[attnum]->attislocal = true;
581
583 {
584 attrtypes[attnum]->attnotnull = true;
585 }
587 {
588 attrtypes[attnum]->attnotnull = false;
589 }
590 else
591 {
593
594 /*
595 * Mark as "not null" if type is fixed-width and prior columns are
596 * likewise fixed-width and not-null. This corresponds to case where
597 * column can be accessed directly via C struct declaration.
598 */
599 if (attrtypes[attnum]->attlen > 0)
600 {
601 int i;
602
603 /* check earlier attributes */
604 for (i = 0; i < attnum; i++)
605 {
606 if (attrtypes[i]->attlen <= 0 ||
608 break;
609 }
610 if (i == attnum)
611 attrtypes[attnum]->attnotnull = true;
612 }
613 }
614}
static Oid gettype(char *type)
Definition bootstrap.c:891
static struct typmap * Ap
Definition bootstrap.c:145
#define BOOTCOL_NULL_FORCE_NULL
Definition bootstrap.h:28
#define BOOTCOL_NULL_FORCE_NOT_NULL
Definition bootstrap.h:29
#define BOOTCOL_NULL_AUTO
Definition bootstrap.h:27
#define MemSet(start, val, len)
Definition c.h:1056
#define WARNING
Definition elog.h:36
void namestrcpy(Name name, const char *str)
Definition name.c:233
NameData attname
int16 attnum
int16 attlen
bool attnotnull
unsigned int Oid
Oid oid
Definition bootstrap.c:78
char storage
Definition bootstrap.c:83
Oid am_oid
Definition bootstrap.c:140
FormData_pg_type am_typ
Definition bootstrap.c:141
#define InvalidCompressionMethod
const char * type

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

◆ gettype()

static Oid gettype ( char type)
static

Definition at line 891 of file bootstrap.c.

892{
893 if (Typ != NIL)
894 {
895 ListCell *lc;
896
897 foreach(lc, Typ)
898 {
899 struct typmap *app = lfirst(lc);
900
901 if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
902 {
903 Ap = app;
904 return app->am_oid;
905 }
906 }
907
908 /*
909 * The type wasn't known; reload the pg_type contents and check again
910 * to handle composite types, added since last populating the list.
911 */
912
914 Typ = NIL;
916
917 /*
918 * Calling gettype would result in infinite recursion for types
919 * missing in pg_type, so just repeat the lookup.
920 */
921 foreach(lc, Typ)
922 {
923 struct typmap *app = lfirst(lc);
924
925 if (strncmp(NameStr(app->am_typ.typname), type, NAMEDATALEN) == 0)
926 {
927 Ap = app;
928 return app->am_oid;
929 }
930 }
931 }
932 else
933 {
934 int i;
935
936 for (i = 0; i < n_types; i++)
937 {
938 if (strncmp(type, TypInfo[i].name, NAMEDATALEN) == 0)
939 return i;
940 }
941 /* Not in TypInfo, so we'd better be able to read pg_type now */
942 elog(DEBUG4, "external type: %s", type);
944 return gettype(type);
945 }
946 elog(ERROR, "unrecognized type \"%s\"", type);
947 /* not reached, here to make compiler happy */
948 return 0;
949}
void list_free_deep(List *list)
Definition list.c:1560

References typmap::am_oid, Ap, DEBUG4, elog, ERROR, fb(), gettype(), i, lfirst, list_free_deep(), n_types, name, NAMEDATALEN, NameStr, NIL, populate_typ_list(), Typ, type, and TypInfo.

Referenced by DefineAttr(), and gettype().

◆ index_register()

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

Definition at line 1063 of file bootstrap.c.

1066{
1069
1070 /*
1071 * XXX mao 10/31/92 -- don't gc index reldescs, associated info at
1072 * bootstrap time. we'll declare the indexes now, but want to create them
1073 * later.
1074 */
1075
1076 if (nogc == NULL)
1078 "BootstrapNoGC",
1080
1082
1084 newind->il_heap = heap;
1085 newind->il_ind = ind;
1086 newind->il_info = palloc_object(IndexInfo);
1087
1088 memcpy(newind->il_info, indexInfo, sizeof(IndexInfo));
1089 /* expressions will likely be null, but may as well copy it */
1090 newind->il_info->ii_Expressions =
1091 copyObject(indexInfo->ii_Expressions);
1092 newind->il_info->ii_ExpressionsState = NIL;
1093 /* predicate will likely be null, but may as well copy it */
1094 newind->il_info->ii_Predicate =
1095 copyObject(indexInfo->ii_Predicate);
1096 newind->il_info->ii_PredicateState = NULL;
1097 /* no exclusion constraints at bootstrap time, so no need to copy */
1098 Assert(indexInfo->ii_ExclusionOps == NULL);
1099 Assert(indexInfo->ii_ExclusionProcs == NULL);
1100 Assert(indexInfo->ii_ExclusionStrats == NULL);
1101
1102 newind->il_next = ILHead;
1103 ILHead = newind;
1104
1106}
static MemoryContext nogc
Definition bootstrap.c:150
#define palloc_object(type)
Definition fe_memutils.h:74
#define AllocSetContextCreate
Definition memutils.h:129
#define ALLOCSET_DEFAULT_SIZES
Definition memutils.h:160
#define copyObject(obj)
Definition nodes.h:232
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition palloc.h:124
uint16 * ii_ExclusionStrats
Definition execnodes.h:194
Oid * ii_ExclusionOps
Definition execnodes.h:190
List * ii_Expressions
Definition execnodes.h:180
Oid * ii_ExclusionProcs
Definition execnodes.h:192
List * ii_Predicate
Definition execnodes.h:185

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, copyObject, fb(), IndexInfo::ii_ExclusionOps, IndexInfo::ii_ExclusionProcs, IndexInfo::ii_ExclusionStrats, IndexInfo::ii_Expressions, IndexInfo::ii_Predicate, ILHead, MemoryContextSwitchTo(), NIL, nogc, and palloc_object.

Referenced by index_create().

◆ InsertOneNull()

void InsertOneNull ( int  i)

Definition at line 820 of file bootstrap.c.

821{
822 elog(DEBUG4, "inserting column %d NULL", i);
823 Assert(i >= 0 && i < MAXATTR);
824 if (TupleDescAttr(boot_reldesc->rd_att, i)->attnotnull)
825 elog(ERROR,
826 "NULL value specified for not-null column \"%s\" of relation \"%s\"",
830 Nulls[i] = true;
831}
static Datum values[MAXATTR]
Definition bootstrap.c:147
static Datum PointerGetDatum(const void *X)
Definition postgres.h:352

References Assert, boot_reldesc, DEBUG4, elog, ERROR, fb(), i, MAXATTR, NameStr, Nulls, PointerGetDatum(), RelationData::rd_att, RelationGetRelationName, TupleDescAttr(), and values.

◆ InsertOneProargdefaultsValue()

static void InsertOneProargdefaultsValue ( char value)
static

Definition at line 720 of file bootstrap.c.

721{
722 int pronargs;
726 bool *array_nulls;
727 int array_count;
729 char *nodestring;
730
731 /* The pg_proc columns we need to use must have been filled already */
733 "pronargs must come before proargdefaults");
735 "pronargdefaults must come before proargdefaults");
737 "proargtypes must come before proargdefaults");
739 elog(ERROR, "pronargs must not be null");
741 elog(ERROR, "proargtypes must not be null");
744 Assert(pronargs == proargtypes->dim1);
745
746 /* Parse the input string as an array value, then deconstruct to Datums */
750 Int32GetDatum(-1));
753
754 /* The values should correspond to the last N argtypes */
755 if (array_count > pronargs)
756 elog(ERROR, "too many proargdefaults entries");
757
758 /* Build the List of Const nodes */
760 for (int i = 0; i < array_count; i++)
761 {
762 Oid argtype = proargtypes->values[pronargs - array_count + i];
763 int16 typlen;
764 bool typbyval;
765 char typalign;
766 char typdelim;
767 Oid typioparam;
769 Oid typoutput;
770 Oid typcollation;
771 Datum defval;
772 bool defnull;
774
775 boot_get_type_io_data(argtype,
776 &typlen, &typbyval, &typalign,
777 &typdelim, &typioparam,
778 &typinput, &typoutput,
779 &typcollation);
780
782 if (defnull)
783 defval = (Datum) 0;
784 else
787 typioparam, -1);
788
789 defConst = makeConst(argtype,
790 -1, /* never any typmod */
791 typcollation,
792 typlen,
793 defval,
794 defnull,
795 typbyval);
797 }
798
799 /*
800 * Flatten the List to a node-tree string, then convert to a text datum,
801 * which is the storage representation of pg_node_tree.
802 */
806
807 /*
808 * Hack: fill in pronargdefaults with the right value. This is surely
809 * ugly, but it beats making the programmer do it.
810 */
813}
#define DatumGetArrayTypeP(X)
Definition array.h:261
void deconstruct_array_builtin(const ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
void boot_get_type_io_data(Oid typid, int16 *typlen, bool *typbyval, char *typalign, char *typdelim, Oid *typioparam, Oid *typinput, Oid *typoutput, Oid *typcollation)
Definition bootstrap.c:963
#define CStringGetTextDatum(s)
Definition builtins.h:98
int16_t int16
Definition c.h:574
#define StaticAssertDecl(condition, errmessage)
Definition c.h:971
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
Definition fmgr.c:1754
#define OidFunctionCall3(functionId, arg1, arg2, arg3)
Definition fmgr.h:726
List * lappend(List *list, void *datum)
Definition list.c:339
Const * makeConst(Oid consttype, int32 consttypmod, Oid constcollid, int constlen, Datum constvalue, bool constisnull, bool constbyval)
Definition makefuncs.c:350
char * nodeToString(const void *obj)
Definition outfuncs.c:802
int16 pronargs
Definition pg_proc.h:83
static Datum Int16GetDatum(int16 X)
Definition postgres.h:182
static Datum ObjectIdGetDatum(Oid X)
Definition postgres.h:262
static char * DatumGetCString(Datum X)
Definition postgres.h:365
uint64_t Datum
Definition postgres.h:70
static Pointer DatumGetPointer(Datum X)
Definition postgres.h:342
static Datum CStringGetDatum(const char *X)
Definition postgres.h:380
static Datum Int32GetDatum(int32 X)
Definition postgres.h:222
static int16 DatumGetInt16(Datum X)
Definition postgres.h:172
Definition pg_list.h:54
Definition c.h:778

References Assert, boot_get_type_io_data(), CStringGetDatum(), CStringGetTextDatum, DatumGetArrayTypeP, DatumGetCString(), DatumGetInt16(), DatumGetPointer(), deconstruct_array_builtin(), elog, ERROR, fb(), i, Int16GetDatum(), Int32GetDatum(), lappend(), makeConst(), NIL, nodeToString(), Nulls, ObjectIdGetDatum(), OidFunctionCall3, OidInputFunctionCall(), pronargs, StaticAssertDecl, typalign, value, and values.

Referenced by InsertOneValue().

◆ InsertOneTuple()

void InsertOneTuple ( void  )

Definition at line 625 of file bootstrap.c.

626{
627 HeapTuple tuple;
628 TupleDesc tupDesc;
629 int i;
630
631 elog(DEBUG4, "inserting row with %d columns", numattr);
632
634 tuple = heap_form_tuple(tupDesc, values, Nulls);
635 pfree(tupDesc); /* just free's tupDesc, not the attrtypes */
636
638 heap_freetuple(tuple);
639 elog(DEBUG4, "row inserted");
640
641 /*
642 * Reset null markers for next tuple
643 */
644 for (i = 0; i < numattr; i++)
645 Nulls[i] = false;
646}
void simple_heap_insert(Relation relation, HeapTuple tup)
Definition heapam.c:2786
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
Definition heaptuple.c:1117
void heap_freetuple(HeapTuple htup)
Definition heaptuple.c:1435
TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs)
Definition tupdesc.c:212

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

◆ InsertOneValue()

void InsertOneValue ( char value,
int  i 
)

Definition at line 653 of file bootstrap.c.

654{
656 Oid typoid;
657 int16 typlen;
658 bool typbyval;
659 char typalign;
660 char typdelim;
661 Oid typioparam;
663 Oid typoutput;
664 Oid typcollation;
665
666 Assert(i >= 0 && i < MAXATTR);
667
668 elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
669
671 typoid = attr->atttypid;
672
674 &typlen, &typbyval, &typalign,
675 &typdelim, &typioparam,
676 &typinput, &typoutput,
677 &typcollation);
678
679 /*
680 * pg_node_tree values can't be inserted normally (pg_node_tree_in would
681 * just error out), so provide special cases for such columns that we
682 * would like to fill during bootstrap.
683 */
684 if (typoid == PG_NODE_TREEOID)
685 {
686 /* pg_proc.proargdefaults */
690 else /* maybe other cases later */
691 elog(ERROR, "can't handle pg_node_tree input for %s.%s",
693 NameStr(attr->attname));
694 }
695 else
696 {
697 /* Normal case */
698 values[i] = OidInputFunctionCall(typinput, value, typioparam, -1);
699 }
700
701 /*
702 * We use ereport not elog here so that parameters aren't evaluated unless
703 * the message is going to be printed, which generally it isn't
704 */
706 (errmsg_internal("inserted -> %s",
707 OidOutputFunctionCall(typoutput, values[i]))));
708}
static void InsertOneProargdefaultsValue(char *value)
Definition bootstrap.c:720
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
char * OidOutputFunctionCall(Oid functionId, Datum val)
Definition fmgr.c:1763
#define RelationGetRelid(relation)
Definition rel.h:514
#define RelationGetDescr(relation)
Definition rel.h:540

References Assert, boot_get_type_io_data(), boot_reldesc, DEBUG4, elog, ereport, errmsg_internal(), ERROR, fb(), i, InsertOneProargdefaultsValue(), MAXATTR, NameStr, OidInputFunctionCall(), OidOutputFunctionCall(), RelationGetDescr, RelationGetRelationName, RelationGetRelid, TupleDescAttr(), typalign, value, and values.

◆ populate_typ_list()

static void populate_typ_list ( void  )
static

Definition at line 851 of file bootstrap.c.

852{
853 Relation rel;
854 TableScanDesc scan;
857
858 Assert(Typ == NIL);
859
861 scan = table_beginscan_catalog(rel, 0, NULL);
863 while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
864 {
866 struct typmap *newtyp;
867
868 newtyp = palloc_object(struct typmap);
869 Typ = lappend(Typ, newtyp);
870
871 newtyp->am_oid = typForm->oid;
872 memcpy(&newtyp->am_typ, typForm, sizeof(newtyp->am_typ));
873 }
875 table_endscan(scan);
876 table_close(rel, NoLock);
877}
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
Definition heapam.c:1410
static void * GETSTRUCT(const HeapTupleData *tuple)
END_CATALOG_STRUCT typedef FormData_pg_type * Form_pg_type
Definition pg_type.h:265
@ ForwardScanDirection
Definition sdir.h:28
TableScanDesc table_beginscan_catalog(Relation relation, int nkeys, ScanKeyData *key)
Definition tableam.c:113
static void table_endscan(TableScanDesc scan)
Definition tableam.h:1004

References Assert, fb(), Form_pg_type, ForwardScanDirection, GETSTRUCT(), heap_getnext(), lappend(), MemoryContextSwitchTo(), NIL, NoLock, palloc_object, table_beginscan_catalog(), table_close(), table_endscan(), table_open(), TopMemoryContext, and Typ.

Referenced by boot_openrel(), and gettype().

Variable Documentation

◆ Ap

struct typmap* Ap = NULL
static

Definition at line 145 of file bootstrap.c.

Referenced by DefineAttr(), and gettype().

◆ attrtypes

Definition at line 62 of file bootstrap.c.

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

◆ boot_reldesc

Relation boot_reldesc

◆ ILHead

IndexList* ILHead = NULL
static

Definition at line 166 of file bootstrap.c.

Referenced by build_indices(), and index_register().

◆ n_types

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

Definition at line 136 of file bootstrap.c.

Referenced by boot_get_type_io_data(), and gettype().

◆ nogc

MemoryContext nogc = NULL
static

Definition at line 150 of file bootstrap.c.

Referenced by index_register().

◆ Nulls

◆ numattr

int numattr

Definition at line 63 of file bootstrap.c.

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

◆ Typ

List* Typ = NIL
static

◆ TypInfo

const struct typinfo TypInfo[]
static

Definition at line 89 of file bootstrap.c.

89 {
90 {"bool", BOOLOID, 0, 1, true, TYPALIGN_CHAR, TYPSTORAGE_PLAIN, InvalidOid,
92 {"bytea", BYTEAOID, 0, -1, false, TYPALIGN_INT, TYPSTORAGE_EXTENDED, InvalidOid,
94 {"char", CHAROID, 0, 1, true, TYPALIGN_CHAR, TYPSTORAGE_PLAIN, InvalidOid,
96 {"cstring", CSTRINGOID, 0, -2, false, TYPALIGN_CHAR, TYPSTORAGE_PLAIN, InvalidOid,
98 {"int2", INT2OID, 0, 2, true, TYPALIGN_SHORT, TYPSTORAGE_PLAIN, InvalidOid,
100 {"int4", INT4OID, 0, 4, true, TYPALIGN_INT, TYPSTORAGE_PLAIN, InvalidOid,
102 {"int8", INT8OID, 0, 8, true, TYPALIGN_DOUBLE, TYPSTORAGE_PLAIN, InvalidOid,
104 {"float4", FLOAT4OID, 0, 4, true, TYPALIGN_INT, TYPSTORAGE_PLAIN, InvalidOid,
106 {"float8", FLOAT8OID, 0, 8, true, TYPALIGN_DOUBLE, TYPSTORAGE_PLAIN, InvalidOid,
110 {"regproc", REGPROCOID, 0, 4, true, TYPALIGN_INT, TYPSTORAGE_PLAIN, InvalidOid,
114 {"jsonb", JSONBOID, 0, -1, false, TYPALIGN_INT, TYPSTORAGE_EXTENDED, InvalidOid,
116 {"oid", OIDOID, 0, 4, true, TYPALIGN_INT, TYPSTORAGE_PLAIN, InvalidOid,
120 {"int2vector", INT2VECTOROID, INT2OID, -1, false, TYPALIGN_INT, TYPSTORAGE_PLAIN, InvalidOid,
122 {"oidvector", OIDVECTOROID, OIDOID, -1, false, TYPALIGN_INT, TYPSTORAGE_PLAIN, InvalidOid,
134};

Referenced by boot_get_type_io_data(), DefineAttr(), and gettype().

◆ values

Datum values[MAXATTR]
static

Definition at line 147 of file bootstrap.c.

Referenced by _bt_build_callback(), _bt_check_unique(), _bt_spool(), _h_spool(), aclexplode(), add_values_to_range(), AddEnumLabel(), AddSubscriptionRelState(), AggregateCreate(), AlterCollation(), AlterDatabaseRefreshColl(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterOperator(), AlterPolicy(), AlterPublicationOptions(), AlterSetting(), AlterSubscription(), AlterTypeRecurse(), apply_returning_filter(), ApplyExtensionUpdates(), array_in(), array_iterate(), array_map(), array_out(), array_replace_internal(), attribute_statistics_update(), blinsert(), bloomBuildCallback(), BloomFormTuple(), brin_deconstruct_tuple(), brin_deform_tuple(), brin_form_tuple(), brin_metapage_info(), brin_page_items(), brinbuildCallback(), brinbuildCallbackParallel(), brininsert(), bt_metap(), bt_multi_page_stats(), bt_page_print_tuples(), bt_page_stats_internal(), bt_tuple_present_callback(), btinsert(), build_index_value_desc(), build_pgstattuple_type(), build_sorted_items(), build_tuplestore_recursively(), BuildIndexValueDescription(), BuildTupleFromCStrings(), CastCreate(), CatalogIndexInsert(), check_conn_params(), check_exclusion_constraint(), check_exclusion_or_unique_constraint(), clear_subscription_skip_lsn(), CollationCreate(), collectTSQueryValues(), comparetup_index_btree_tiebreak(), compute_index_stats(), compute_partition_hash_value(), compute_scalar_stats(), connect_pg_server(), ConnectDatabase(), connectDatabase(), conninfo_array_parse(), constructConnStr(), ConversionCreate(), convert_VALUES_to_ANY(), copy_replication_slot(), CopyArrayEls(), CopyFromBinaryOneRow(), CopyFromCSVOneRow(), CopyFromTextLikeOneRow(), CopyFromTextOneRow(), create_cursor(), CreateAccessMethod(), CreateComments(), CreateConstraintEntry(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateOpFamily(), CreatePolicy(), CreateProceduralLanguage(), CreatePublication(), CreateReplicationSlot(), CreateSharedComments(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTriggerFiringOn(), CreateUserMapping(), crosstab(), dblink_get_notify(), dblink_get_pkey(), DefineOpClass(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), DisableSubscription(), DiscreteKnapsack(), do_connect(), do_text_output_multiline(), do_tup_output(), doConnect(), each_object_field_end(), each_worker_jsonb(), elements_array_element_end(), elements_worker_jsonb(), exec_move_row(), exec_move_row_from_fields(), ExecBuildAggTrans(), ExecBuildSlotPartitionKeyDescription(), ExecCheckIndexConstraints(), ExecComputeStoredGenerated(), ExecEvalMinMax(), ExecEvalXmlExpr(), ExecFilterJunk(), ExecFindPartition(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), ExecInitExprRec(), ExecInsertIndexTuples(), execute_dml_stmt(), extended_statistics_update(), ExtractConnectionOptions(), ExtractReplicaIdentity(), file_acquire_sample_rows(), fill_hba_line(), fill_ident_line(), FillXLogStatsRow(), FormIndexDatum(), FormPartitionKeyDatum(), get_actual_variable_endpoint(), get_altertable_subcmdinfo(), get_available_versions_for_extension(), get_crosstab_tuplestore(), get_matching_hash_bounds(), get_matching_range_bounds(), get_partition_for_tuple(), get_text_array_contents(), GetConfigOptionValues(), GetConnection(), GetWALBlockInfo(), GetWALRecordInfo(), GetWALRecordsInfo(), GetWalStats(), GetXLogSummaryStats(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginBuildCallback(), ginBuildCallbackParallel(), gininsert(), gist_page_items(), gist_page_items_bytea(), gist_page_opaque_info(), gistBuildCallback(), gistinsert(), gistSortedBuildCallback(), hash_bitmap_info(), hash_metapage_info(), hash_page_items(), hash_page_stats(), hash_record(), hash_record_extended(), hashbuildCallback(), hashinsert(), heap_compute_data_size(), heap_deform_tuple(), heap_fill_tuple(), heap_form_minimal_tuple(), heap_form_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_deform_tuple(), index_deform_tuple_internal(), index_form_tuple(), index_form_tuple_context(), index_insert(), index_truncate_tuple(), IndexCheckExclusion(), inet_hist_value_sel(), injection_points_list(), insert_event_trigger_tuple(), InsertExtensionTuple(), InsertOneNull(), InsertOneProargdefaultsValue(), InsertOneTuple(), InsertOneValue(), InsertPgClassTuple(), InsertRule(), intset_flush_buffered_values(), inv_truncate(), inv_write(), LargeObjectCreate(), libpqsrv_connect_params(), LogicalOutputWrite(), logicalrep_write_tuple(), main(), main(), make_tuple_from_result_row(), make_tuple_indirect(), materializeQueryResult(), materializeResult(), minmax_multi_init(), NamespaceCreate(), ndistinct_for_combination(), NextCopyFrom(), oid_array_to_list(), OperatorCreate(), OperatorShellMake(), page_header(), ParameterAclCreate(), parse_key_value_arrays(), parseLocalRelOptions(), partition_range_datum_bsearch(), perform_pruning_base_step(), pg_armor(), pg_available_extensions(), pg_available_wal_summaries(), pg_backup_stop(), pg_buffercache_evict(), pg_buffercache_evict_all(), pg_buffercache_evict_relation(), pg_buffercache_mark_dirty(), pg_buffercache_mark_dirty_all(), pg_buffercache_mark_dirty_relation(), pg_buffercache_os_pages_internal(), pg_buffercache_pages(), pg_buffercache_summary(), pg_buffercache_usage_counts(), 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_aios(), pg_get_catalog_foreign_keys(), pg_get_keywords(), pg_get_loaded_modules(), pg_get_logical_snapshot_info(), pg_get_logical_snapshot_meta(), pg_get_multixact_members(), pg_get_multixact_stats(), pg_get_object_address(), pg_get_publication_tables(), pg_get_replication_slots(), pg_get_sequence_data(), pg_get_shmem_allocations(), pg_get_shmem_allocations_numa(), pg_get_wait_events(), pg_get_wal_record_info(), pg_get_wal_resource_managers(), pg_get_wal_summarizer_state(), pg_identify_object(), pg_identify_object_as_address(), pg_input_error_info(), pg_last_committed_xact(), pg_lock_status(), pg_ls_dir(), pg_ls_dir_files(), pg_options_to_table(), pg_partition_tree(), pg_prepared_statement(), pg_prepared_xact(), pg_replication_slot_advance(), pg_sequence_parameters(), pg_show_replication_origin_status(), pg_split_walfile_name(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_archiver(), pg_stat_get_backend_subxact(), pg_stat_get_progress_info(), pg_stat_get_recovery_prefetch(), pg_stat_get_replication_slot(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_subscription_stats(), pg_stat_get_wal_receiver(), pg_stat_get_wal_senders(), pg_stat_io_build_tuples(), pg_stat_statements_info(), pg_stat_statements_internal(), pg_stat_wal_build_tuple(), pg_stats_ext_mcvlist_items(), pg_tablespace_databases(), pg_timezone_abbrevs_abbrevs(), pg_timezone_abbrevs_zone(), pg_timezone_names(), pg_visibility(), pg_visibility_map(), pg_visibility_map_rel(), pg_visibility_map_summary(), pg_visibility_rel(), pg_wal_summary_contents(), pg_walfile_name_offset(), pg_xact_commit_timestamp_origin(), pgfdw_has_required_scram_options(), pgfdw_security_check(), pgp_armor_encode(), pgp_armor_headers(), pgp_extract_armor_headers(), pgrowlocks(), pgstatginindex_internal(), pgstathashindex(), pgstatindex_impl(), pgstattuple_approx_internal(), plperl_build_tuple_result(), pltcl_build_tuple_result(), PLy_cursor_plan(), PLy_spi_execute_plan(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLySequence_ToComposite(), populate_record(), postgres_fdw_get_connections_internal(), PQconnectdbParams(), PQconnectStartParams(), PQpingParams(), ProcedureCreate(), prs_process_call(), publication_add_relation(), publication_add_schema(), PutMemoryContextsStatsTupleStore(), RangeCreate(), ReadArrayBinary(), ReadArrayStr(), ReadReplicationSlot(), record_in(), record_out(), record_recv(), record_send(), recordExtensionInitPrivWorker(), reduce_expanded_ranges(), reform_and_rewrite_tuple(), regression_main(), relation_statistics_update(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectPolicy(), ReplaceRoleInInitPriv(), replorigin_create(), report_corruption_internal(), SendTablespaceList(), SendXlogRecPtrResult(), serialize_expr_stats(), SetDefaultACL(), SetSecurityLabel(), SetSharedSecurityLabel(), shdepAddDependency(), shdepChangeDep(), show_all_file_settings(), show_all_settings(), ShowAllGUCConfig(), slot_deform_heap_tuple_internal(), spginsert(), spgistBuildCallback(), split_text_accum_result(), sql_conn(), ssl_extension_info(), StartReplication(), statatt_init_empty_tuple(), statatt_set_slot(), statext_mcv_serialize(), statext_store(), StoreAttrDefault(), storeOperators(), StorePartitionKey(), storeProcedures(), StoreSingleInheritance(), test_custom_stats_fixed_report(), test_custom_stats_var_report(), test_enc_conversion(), test_huge_distances(), test_predtest(), tfuncLoadRows(), toast_build_flattened_tuple(), toast_delete_external(), TransformGUCArray(), ts_process_call(), tsvector_unnest(), tt_process_call(), tuplesort_putindextuplevalues(), tuplestore_putvalues(), TypeCreate(), TypeShellMake(), unique_key_recheck(), update_attstats(), UpdateDeadTupleRetentionStatus(), UpdateIndexRelation(), UpdateSubscriptionRelState(), UpdateTwoPhaseState(), upsert_pg_statistic(), upsert_pg_statistic_ext_data(), vacuumlo(), ValuesNext(), WaitForLockersMultiple(), and xpath_table().