MCPcopy Create free account
hub / github.com/apache/cloudberry / populate_typ_list

Function populate_typ_list

src/backend/bootstrap/bootstrap.c:919–946  ·  view source on GitHub ↗

---------------- * populate_typ_list * * Load the Typ list by reading pg_type. * ---------------- */

Source from the content-addressed store, hash-verified

917 * ----------------
918 */
919static void
920populate_typ_list(void)
921{
922 Relation rel;
923 TableScanDesc scan;
924 HeapTuple tup;
925 MemoryContext old;
926
927 Assert(Typ == NIL);
928
929 rel = table_open(TypeRelationId, NoLock);
930 scan = table_beginscan_catalog(rel, 0, NULL);
931 old = MemoryContextSwitchTo(TopMemoryContext);
932 while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
933 {
934 Form_pg_type typForm = (Form_pg_type) GETSTRUCT(tup);
935 struct typmap *newtyp;
936
937 newtyp = (struct typmap *) palloc(sizeof(struct typmap));
938 Typ = lappend(Typ, newtyp);
939
940 newtyp->am_oid = typForm->oid;
941 memcpy(&newtyp->am_typ, typForm, sizeof(newtyp->am_typ));
942 }
943 MemoryContextSwitchTo(old);
944 table_endscan(scan);
945 table_close(rel, NoLock);
946}
947
948/* ----------------
949 * gettype

Callers 2

boot_openrelFunction · 0.85
gettypeFunction · 0.85

Calls 8

table_openFunction · 0.85
table_beginscan_catalogFunction · 0.85
MemoryContextSwitchToFunction · 0.85
heap_getnextFunction · 0.85
lappendFunction · 0.85
table_endscanFunction · 0.85
table_closeFunction · 0.85
pallocFunction · 0.50

Tested by

no test coverage detected