PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
common.c File Reference
#include "postgres_fe.h"
#include "pg_backup_archiver.h"
#include "pg_backup_utils.h"
#include "pg_dump.h"
#include <ctype.h>
#include "catalog/pg_class.h"
#include "fe_utils/string_utils.h"
Include dependency graph for common.c:

Go to the source code of this file.

Functions

static void flagInhTables (Archive *fout, TableInfo *tbinfo, int numTables, InhInfo *inhinfo, int numInherits)
 
static void flagInhAttrs (DumpOptions *dopt, TableInfo *tblinfo, int numTables)
 
static DumpableObject ** buildIndexArray (void *objArray, int numObjs, Size objSize)
 
static int DOCatalogIdCompare (const void *p1, const void *p2)
 
static int ExtensionMemberIdCompare (const void *p1, const void *p2)
 
static void findParentsByOid (TableInfo *self, InhInfo *inhinfo, int numInherits)
 
static int strInArray (const char *pattern, char **arr, int arr_size)
 
TableInfogetSchemaData (Archive *fout, int *numTablesPtr)
 
void AssignDumpId (DumpableObject *dobj)
 
DumpId createDumpId (void)
 
DumpId getMaxDumpId (void)
 
DumpableObjectfindObjectByDumpId (DumpId dumpId)
 
DumpableObjectfindObjectByCatalogId (CatalogId catalogId)
 
static DumpableObjectfindObjectByOid (Oid oid, DumpableObject **indexArray, int numObjs)
 
void getDumpableObjects (DumpableObject ***objs, int *numObjs)
 
void addObjectDependency (DumpableObject *dobj, DumpId refId)
 
void removeObjectDependency (DumpableObject *dobj, DumpId refId)
 
TableInfofindTableByOid (Oid oid)
 
TypeInfofindTypeByOid (Oid oid)
 
FuncInfofindFuncByOid (Oid oid)
 
OprInfofindOprByOid (Oid oid)
 
CollInfofindCollationByOid (Oid oid)
 
NamespaceInfofindNamespaceByOid (Oid oid)
 
ExtensionInfofindExtensionByOid (Oid oid)
 
void setExtensionMembership (ExtensionMemberId *extmems, int nextmems)
 
ExtensionInfofindOwningExtension (CatalogId catalogId)
 
void parseOidArray (const char *str, Oid *array, int arraysize)
 

Variables

static DumpableObject ** dumpIdMap = NULL
 
static int allocedDumpIds = 0
 
static DumpId lastDumpId = 0
 
static bool catalogIdMapValid = false
 
static DumpableObject ** catalogIdMap = NULL
 
static int numCatalogIds = 0
 
static DumpableObject ** tblinfoindex
 
static DumpableObject ** typinfoindex
 
static DumpableObject ** funinfoindex
 
static DumpableObject ** oprinfoindex
 
static DumpableObject ** collinfoindex
 
static DumpableObject ** nspinfoindex
 
static DumpableObject ** extinfoindex
 
static int numTables
 
static int numTypes
 
static int numFuncs
 
static int numOperators
 
static int numCollations
 
static int numNamespaces
 
static int numExtensions
 
static ExtensionMemberIdextmembers
 
static int numextmembers
 

Function Documentation

void addObjectDependency ( DumpableObject dobj,
DumpId  refId 
)

Definition at line 712 of file common.c.

References _dumpableObject::allocDeps, _dumpableObject::dependencies, _dumpableObject::nDeps, pg_malloc(), and pg_realloc().

Referenced by addBoundaryDependencies(), buildMatViewRefreshDependencies(), checkExtensionMembership(), flagInhAttrs(), getDependencies(), getDomainConstraints(), getRules(), getTableAttrs(), getTableDataFKConstraints(), makeTableDataInfo(), processExtensionTables(), repairDomainConstraintMultiLoop(), repairTableAttrDefMultiLoop(), repairTableConstraintMultiLoop(), repairTypeFuncLoop(), and repairViewRuleMultiLoop().

713 {
714  if (dobj->nDeps >= dobj->allocDeps)
715  {
716  if (dobj->allocDeps <= 0)
717  {
718  dobj->allocDeps = 16;
719  dobj->dependencies = (DumpId *)
720  pg_malloc(dobj->allocDeps * sizeof(DumpId));
721  }
722  else
723  {
724  dobj->allocDeps *= 2;
725  dobj->dependencies = (DumpId *)
726  pg_realloc(dobj->dependencies,
727  dobj->allocDeps * sizeof(DumpId));
728  }
729  }
730  dobj->dependencies[dobj->nDeps++] = refId;
731 }
int DumpId
Definition: pg_backup.h:230
DumpId * dependencies
Definition: pg_dump.h:138
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
void * pg_realloc(void *ptr, size_t size)
Definition: fe_memutils.c:65
void AssignDumpId ( DumpableObject dobj)

Definition at line 476 of file common.c.

References _dumpableObject::allocDeps, allocedDumpIds, catalogIdMapValid, _dumpableObject::dependencies, _dumpableObject::dump, DUMP_COMPONENT_ALL, _dumpableObject::dumpId, _dumpableObject::ext_member, lastDumpId, _dumpableObject::name, _dumpableObject::nDeps, pg_malloc(), and pg_realloc().

Referenced by createBoundaryObjects(), flagInhAttrs(), getAccessMethods(), getAggregates(), getBlobs(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublications(), getPublicationTables(), getRules(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), and makeTableDataInfo().

477 {
478  dobj->dumpId = ++lastDumpId;
479  dobj->name = NULL; /* must be set later */
480  dobj->namespace = NULL; /* may be set later */
481  dobj->dump = DUMP_COMPONENT_ALL; /* default assumption */
482  dobj->ext_member = false; /* default assumption */
483  dobj->dependencies = NULL;
484  dobj->nDeps = 0;
485  dobj->allocDeps = 0;
486 
487  while (dobj->dumpId >= allocedDumpIds)
488  {
489  int newAlloc;
490 
491  if (allocedDumpIds <= 0)
492  {
493  newAlloc = 256;
495  pg_malloc(newAlloc * sizeof(DumpableObject *));
496  }
497  else
498  {
499  newAlloc = allocedDumpIds * 2;
501  pg_realloc(dumpIdMap, newAlloc * sizeof(DumpableObject *));
502  }
503  memset(dumpIdMap + allocedDumpIds, 0,
504  (newAlloc - allocedDumpIds) * sizeof(DumpableObject *));
505  allocedDumpIds = newAlloc;
506  }
507  dumpIdMap[dobj->dumpId] = dobj;
508 
509  /* mark catalogIdMap invalid, but don't rebuild it yet */
510  catalogIdMapValid = false;
511 }
char * name
Definition: pg_dump.h:133
static int allocedDumpIds
Definition: common.c:32
DumpComponents dump
Definition: pg_dump.h:134
static DumpId lastDumpId
Definition: common.c:33
static DumpableObject ** dumpIdMap
Definition: common.c:31
DumpId * dependencies
Definition: pg_dump.h:138
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
DumpId dumpId
Definition: pg_dump.h:132
bool ext_member
Definition: pg_dump.h:137
void * pg_realloc(void *ptr, size_t size)
Definition: fe_memutils.c:65
static bool catalogIdMapValid
Definition: common.c:38
#define DUMP_COMPONENT_ALL
Definition: pg_dump.h:99
static DumpableObject ** buildIndexArray ( void *  objArray,
int  numObjs,
Size  objSize 
)
static

Definition at line 647 of file common.c.

References DOCatalogIdCompare(), i, pg_malloc(), and qsort.

Referenced by getSchemaData().

648 {
649  DumpableObject **ptrs;
650  int i;
651 
652  ptrs = (DumpableObject **) pg_malloc(numObjs * sizeof(DumpableObject *));
653  for (i = 0; i < numObjs; i++)
654  ptrs[i] = (DumpableObject *) ((char *) objArray + i * objSize);
655 
656  /* We can use DOCatalogIdCompare to sort since its first key is OID */
657  if (numObjs > 1)
658  qsort((void *) ptrs, numObjs, sizeof(DumpableObject *),
660 
661  return ptrs;
662 }
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
static int DOCatalogIdCompare(const void *p1, const void *p2)
Definition: common.c:668
int i
#define qsort(a, b, c, d)
Definition: port.h:443
DumpId createDumpId ( void  )
static int DOCatalogIdCompare ( const void *  p1,
const void *  p2 
)
static

Definition at line 668 of file common.c.

References _dumpableObject::catId, CatalogId::oid, oidcmp, and CatalogId::tableoid.

Referenced by buildIndexArray(), and findObjectByCatalogId().

669 {
670  const DumpableObject *obj1 = *(DumpableObject *const *) p1;
671  const DumpableObject *obj2 = *(DumpableObject *const *) p2;
672  int cmpval;
673 
674  /*
675  * Compare OID first since it's usually unique, whereas there will only be
676  * a few distinct values of tableoid.
677  */
678  cmpval = oidcmp(obj1->catId.oid, obj2->catId.oid);
679  if (cmpval == 0)
680  cmpval = oidcmp(obj1->catId.tableoid, obj2->catId.tableoid);
681  return cmpval;
682 }
Oid tableoid
Definition: pg_backup.h:226
#define oidcmp(x, y)
Definition: pg_dump.h:20
CatalogId catId
Definition: pg_dump.h:131
static int ExtensionMemberIdCompare ( const void *  p1,
const void *  p2 
)
static

Definition at line 890 of file common.c.

References _extensionMemberId::catId, CatalogId::oid, oidcmp, and CatalogId::tableoid.

Referenced by setExtensionMembership().

891 {
892  const ExtensionMemberId *obj1 = (const ExtensionMemberId *) p1;
893  const ExtensionMemberId *obj2 = (const ExtensionMemberId *) p2;
894  int cmpval;
895 
896  /*
897  * Compare OID first since it's usually unique, whereas there will only be
898  * a few distinct values of tableoid.
899  */
900  cmpval = oidcmp(obj1->catId.oid, obj2->catId.oid);
901  if (cmpval == 0)
902  cmpval = oidcmp(obj1->catId.tableoid, obj2->catId.tableoid);
903  return cmpval;
904 }
Oid tableoid
Definition: pg_backup.h:226
#define oidcmp(x, y)
Definition: pg_dump.h:20
CatalogId catId
Definition: pg_dump.h:620
CollInfo* findCollationByOid ( Oid  oid)

Definition at line 803 of file common.c.

References findObjectByOid(), and numCollations.

Referenced by createDummyViewAsClause(), dumpCompositeType(), dumpDomain(), dumpRangeType(), and dumpTableSchema().

804 {
806 }
static DumpableObject ** collinfoindex
Definition: common.c:54
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static int numCollations
Definition: common.c:61
ExtensionInfo* findExtensionByOid ( Oid  oid)

Definition at line 825 of file common.c.

References findObjectByOid(), and numExtensions.

Referenced by getExtensionMembership().

826 {
828 }
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static int numExtensions
Definition: common.c:63
static DumpableObject ** extinfoindex
Definition: common.c:56
FuncInfo* findFuncByOid ( Oid  oid)

Definition at line 781 of file common.c.

References findObjectByOid(), and numFuncs.

Referenced by dumpCast(), dumpProcLang(), and dumpTransform().

782 {
783  return (FuncInfo *) findObjectByOid(oid, funinfoindex, numFuncs);
784 }
static int numFuncs
Definition: common.c:59
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static DumpableObject ** funinfoindex
Definition: common.c:52
NamespaceInfo* findNamespaceByOid ( Oid  oid)

Definition at line 814 of file common.c.

References findObjectByOid(), and numNamespaces.

Referenced by findNamespace().

815 {
817 }
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static int numNamespaces
Definition: common.c:62
static DumpableObject ** nspinfoindex
Definition: common.c:55
DumpableObject* findObjectByCatalogId ( CatalogId  catalogId)

Definition at line 558 of file common.c.

References catalogIdMap, catalogIdMapValid, difference(), DOCatalogIdCompare(), free, getDumpableObjects(), numCatalogIds, CatalogId::oid, oidcmp, qsort, and CatalogId::tableoid.

Referenced by buildMatViewRefreshDependencies(), and getDependencies().

559 {
560  DumpableObject **low;
561  DumpableObject **high;
562 
563  if (!catalogIdMapValid)
564  {
565  if (catalogIdMap)
568  if (numCatalogIds > 1)
569  qsort((void *) catalogIdMap, numCatalogIds,
571  catalogIdMapValid = true;
572  }
573 
574  /*
575  * We could use bsearch() here, but the notational cruft of calling
576  * bsearch is nearly as bad as doing it ourselves; and the generalized
577  * bsearch function is noticeably slower as well.
578  */
579  if (numCatalogIds <= 0)
580  return NULL;
581  low = catalogIdMap;
582  high = catalogIdMap + (numCatalogIds - 1);
583  while (low <= high)
584  {
585  DumpableObject **middle;
586  int difference;
587 
588  middle = low + (high - low) / 2;
589  /* comparison must match DOCatalogIdCompare, below */
590  difference = oidcmp((*middle)->catId.oid, catalogId.oid);
591  if (difference == 0)
592  difference = oidcmp((*middle)->catId.tableoid, catalogId.tableoid);
593  if (difference == 0)
594  return *middle;
595  else if (difference < 0)
596  low = middle + 1;
597  else
598  high = middle - 1;
599  }
600  return NULL;
601 }
Oid tableoid
Definition: pg_backup.h:226
#define oidcmp(x, y)
Definition: pg_dump.h:20
static int DOCatalogIdCompare(const void *p1, const void *p2)
Definition: common.c:668
static int numCatalogIds
Definition: common.c:40
Datum difference(PG_FUNCTION_ARGS)
#define free(a)
Definition: header.h:65
static DumpableObject ** catalogIdMap
Definition: common.c:39
static bool catalogIdMapValid
Definition: common.c:38
#define qsort(a, b, c, d)
Definition: port.h:443
void getDumpableObjects(DumpableObject ***objs, int *numObjs)
Definition: common.c:690
DumpableObject* findObjectByDumpId ( DumpId  dumpId)

Definition at line 540 of file common.c.

References allocedDumpIds.

Referenced by binary_upgrade_extension_member(), BuildArchiveDependencies(), dumpConstraint(), dumpExtension(), findDumpableDependencies(), and findLoop().

541 {
542  if (dumpId <= 0 || dumpId >= allocedDumpIds)
543  return NULL; /* out of range? */
544  return dumpIdMap[dumpId];
545 }
static int allocedDumpIds
Definition: common.c:32
static DumpableObject ** dumpIdMap
Definition: common.c:31
static DumpableObject* findObjectByOid ( Oid  oid,
DumpableObject **  indexArray,
int  numObjs 
)
static

Definition at line 609 of file common.c.

References difference(), and oidcmp.

Referenced by findCollationByOid(), findExtensionByOid(), findFuncByOid(), findNamespaceByOid(), findOprByOid(), findTableByOid(), and findTypeByOid().

610 {
611  DumpableObject **low;
612  DumpableObject **high;
613 
614  /*
615  * This is the same as findObjectByCatalogId except we assume we need not
616  * look at table OID because the objects are all the same type.
617  *
618  * We could use bsearch() here, but the notational cruft of calling
619  * bsearch is nearly as bad as doing it ourselves; and the generalized
620  * bsearch function is noticeably slower as well.
621  */
622  if (numObjs <= 0)
623  return NULL;
624  low = indexArray;
625  high = indexArray + (numObjs - 1);
626  while (low <= high)
627  {
628  DumpableObject **middle;
629  int difference;
630 
631  middle = low + (high - low) / 2;
632  difference = oidcmp((*middle)->catId.oid, oid);
633  if (difference == 0)
634  return *middle;
635  else if (difference < 0)
636  low = middle + 1;
637  else
638  high = middle - 1;
639  }
640  return NULL;
641 }
#define oidcmp(x, y)
Definition: pg_dump.h:20
Datum difference(PG_FUNCTION_ARGS)
OprInfo* findOprByOid ( Oid  oid)

Definition at line 792 of file common.c.

References findObjectByOid(), and numOperators.

793 {
795 }
static DumpableObject ** oprinfoindex
Definition: common.c:53
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static int numOperators
Definition: common.c:60
ExtensionInfo* findOwningExtension ( CatalogId  catalogId)

Definition at line 852 of file common.c.

References _extensionMemberId::catId, difference(), _extensionMemberId::ext, extmembers, numextmembers, CatalogId::oid, oidcmp, and CatalogId::tableoid.

Referenced by checkExtensionMembership().

853 {
854  ExtensionMemberId *low;
855  ExtensionMemberId *high;
856 
857  /*
858  * We could use bsearch() here, but the notational cruft of calling
859  * bsearch is nearly as bad as doing it ourselves; and the generalized
860  * bsearch function is noticeably slower as well.
861  */
862  if (numextmembers <= 0)
863  return NULL;
864  low = extmembers;
865  high = extmembers + (numextmembers - 1);
866  while (low <= high)
867  {
868  ExtensionMemberId *middle;
869  int difference;
870 
871  middle = low + (high - low) / 2;
872  /* comparison must match ExtensionMemberIdCompare, below */
873  difference = oidcmp(middle->catId.oid, catalogId.oid);
874  if (difference == 0)
875  difference = oidcmp(middle->catId.tableoid, catalogId.tableoid);
876  if (difference == 0)
877  return middle->ext;
878  else if (difference < 0)
879  low = middle + 1;
880  else
881  high = middle - 1;
882  }
883  return NULL;
884 }
ExtensionInfo * ext
Definition: pg_dump.h:621
Oid tableoid
Definition: pg_backup.h:226
#define oidcmp(x, y)
Definition: pg_dump.h:20
Datum difference(PG_FUNCTION_ARGS)
static ExtensionMemberId * extmembers
Definition: common.c:66
static int numextmembers
Definition: common.c:67
CatalogId catId
Definition: pg_dump.h:620
static void findParentsByOid ( TableInfo self,
InhInfo inhinfo,
int  numInherits 
)
static

Definition at line 912 of file common.c.

References exit_nicely, findTableByOid(), i, _tableInfo::parents, pg_malloc(), and write_msg().

Referenced by flagInhTables().

914 {
915  Oid oid = self->dobj.catId.oid;
916  int i,
917  j;
918  int numParents;
919 
920  numParents = 0;
921  for (i = 0; i < numInherits; i++)
922  {
923  if (inhinfo[i].inhrelid == oid)
924  numParents++;
925  }
926 
927  self->numParents = numParents;
928 
929  if (numParents > 0)
930  {
931  self->parents = (TableInfo **)
932  pg_malloc(sizeof(TableInfo *) * numParents);
933  j = 0;
934  for (i = 0; i < numInherits; i++)
935  {
936  if (inhinfo[i].inhrelid == oid)
937  {
938  TableInfo *parent;
939 
940  parent = findTableByOid(inhinfo[i].inhparent);
941  if (parent == NULL)
942  {
943  write_msg(NULL, "failed sanity check, parent OID %u of table \"%s\" (OID %u) not found\n",
944  inhinfo[i].inhparent,
945  self->dobj.name,
946  oid);
947  exit_nicely(1);
948  }
949  self->parents[j++] = parent;
950  }
951  }
952  }
953  else
954  self->parents = NULL;
955 }
char * name
Definition: pg_dump.h:133
TableInfo * findTableByOid(Oid oid)
Definition: common.c:759
struct _tableInfo ** parents
Definition: pg_dump.h:330
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
unsigned int Oid
Definition: postgres_ext.h:31
DumpableObject dobj
Definition: pg_dump.h:261
#define exit_nicely(code)
Definition: pg_dumpall.c:92
void write_msg(const char *modulename, const char *fmt,...)
int i
TableInfo* findTableByOid ( Oid  oid)

Definition at line 759 of file common.c.

References findObjectByOid(), and numTables.

Referenced by dumpSequence(), findParentsByOid(), getOwnedSeqs(), getRules(), getTableDataFKConstraints(), processExtensionTables(), and selectDumpableType().

760 {
762 }
static int numTables
Definition: common.c:57
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static DumpableObject ** tblinfoindex
Definition: common.c:50
TypeInfo* findTypeByOid ( Oid  oid)

Definition at line 770 of file common.c.

References findObjectByOid(), and numTypes.

Referenced by DOTypeNameCompare(), getCasts(), and getTransforms().

771 {
772  return (TypeInfo *) findObjectByOid(oid, typinfoindex, numTypes);
773 }
static int numTypes
Definition: common.c:58
static DumpableObject * findObjectByOid(Oid oid, DumpableObject **indexArray, int numObjs)
Definition: common.c:609
static DumpableObject ** typinfoindex
Definition: common.c:51
static void flagInhAttrs ( DumpOptions dopt,
TableInfo tblinfo,
int  numTables 
)
static

Definition at line 370 of file common.c.

References addObjectDependency(), _attrDefInfo::adef_expr, _attrDefInfo::adnum, _attrDefInfo::adtable, AssignDumpId(), _tableInfo::attisdropped, _tableInfo::attnames, _tableInfo::attrdefs, _dumpableObject::catId, DO_ATTRDEF, _tableInfo::dobj, _attrDefInfo::dobj, _dumpableObject::dump, _dumpableObject::dumpId, i, _tableInfo::inhNotNull, _dumpableObject::name, _tableInfo::notnull, _tableInfo::numatts, _tableInfo::numParents, numTables, _dumpableObject::objType, CatalogId::oid, _tableInfo::parents, pg_malloc(), pg_strdup(), _tableInfo::relkind, RELKIND_MATVIEW, RELKIND_SEQUENCE, RELKIND_VIEW, _attrDefInfo::separate, shouldPrintColumn(), strInArray(), and CatalogId::tableoid.

Referenced by getSchemaData().

371 {
372  int i,
373  j,
374  k;
375 
376  for (i = 0; i < numTables; i++)
377  {
378  TableInfo *tbinfo = &(tblinfo[i]);
379  int numParents;
380  TableInfo **parents;
381 
382  /* Some kinds never have parents */
383  if (tbinfo->relkind == RELKIND_SEQUENCE ||
384  tbinfo->relkind == RELKIND_VIEW ||
385  tbinfo->relkind == RELKIND_MATVIEW)
386  continue;
387 
388  /* Don't bother computing anything for non-target tables, either */
389  if (!tbinfo->dobj.dump)
390  continue;
391 
392  numParents = tbinfo->numParents;
393  parents = tbinfo->parents;
394 
395  if (numParents == 0)
396  continue; /* nothing to see here, move along */
397 
398  /* For each column, search for matching column names in parent(s) */
399  for (j = 0; j < tbinfo->numatts; j++)
400  {
401  bool foundNotNull; /* Attr was NOT NULL in a parent */
402  bool foundDefault; /* Found a default in a parent */
403 
404  /* no point in examining dropped columns */
405  if (tbinfo->attisdropped[j])
406  continue;
407 
408  foundNotNull = false;
409  foundDefault = false;
410  for (k = 0; k < numParents; k++)
411  {
412  TableInfo *parent = parents[k];
413  int inhAttrInd;
414 
415  inhAttrInd = strInArray(tbinfo->attnames[j],
416  parent->attnames,
417  parent->numatts);
418  if (inhAttrInd >= 0)
419  {
420  foundNotNull |= parent->notnull[inhAttrInd];
421  foundDefault |= (parent->attrdefs[inhAttrInd] != NULL);
422  }
423  }
424 
425  /* Remember if we found inherited NOT NULL */
426  tbinfo->inhNotNull[j] = foundNotNull;
427 
428  /* Manufacture a DEFAULT NULL clause if necessary */
429  if (foundDefault && tbinfo->attrdefs[j] == NULL)
430  {
431  AttrDefInfo *attrDef;
432 
433  attrDef = (AttrDefInfo *) pg_malloc(sizeof(AttrDefInfo));
434  attrDef->dobj.objType = DO_ATTRDEF;
435  attrDef->dobj.catId.tableoid = 0;
436  attrDef->dobj.catId.oid = 0;
437  AssignDumpId(&attrDef->dobj);
438  attrDef->dobj.name = pg_strdup(tbinfo->dobj.name);
439  attrDef->dobj.namespace = tbinfo->dobj.namespace;
440  attrDef->dobj.dump = tbinfo->dobj.dump;
441 
442  attrDef->adtable = tbinfo;
443  attrDef->adnum = j + 1;
444  attrDef->adef_expr = pg_strdup("NULL");
445 
446  /* Will column be dumped explicitly? */
447  if (shouldPrintColumn(dopt, tbinfo, j))
448  {
449  attrDef->separate = false;
450  /* No dependency needed: NULL cannot have dependencies */
451  }
452  else
453  {
454  /* column will be suppressed, print default separately */
455  attrDef->separate = true;
456  /* ensure it comes out after the table */
457  addObjectDependency(&attrDef->dobj,
458  tbinfo->dobj.dumpId);
459  }
460 
461  tbinfo->attrdefs[j] = attrDef;
462  }
463  }
464  }
465 }
char * name
Definition: pg_dump.h:133
struct _tableInfo ** parents
Definition: pg_dump.h:330
char relkind
Definition: pg_dump.h:267
DumpComponents dump
Definition: pg_dump.h:134
Oid tableoid
Definition: pg_backup.h:226
void AssignDumpId(DumpableObject *dobj)
Definition: common.c:476
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
bool shouldPrintColumn(DumpOptions *dopt, TableInfo *tbinfo, int colno)
Definition: pg_dump.c:8305
#define RELKIND_MATVIEW
Definition: pg_class.h:165
bool * inhNotNull
Definition: pg_dump.h:319
DumpId dumpId
Definition: pg_dump.h:132
static int numTables
Definition: common.c:57
char ** attnames
Definition: pg_dump.h:304
DumpableObject dobj
Definition: pg_dump.h:261
static int strInArray(const char *pattern, char **arr, int arr_size)
Definition: common.c:1020
bool separate
Definition: pg_dump.h:342
char * pg_strdup(const char *in)
Definition: fe_memutils.c:85
bool * attisdropped
Definition: pg_dump.h:310
TableInfo * adtable
Definition: pg_dump.h:339
int numatts
Definition: pg_dump.h:303
bool * notnull
Definition: pg_dump.h:318
DumpableObject dobj
Definition: pg_dump.h:338
struct _attrDefInfo ** attrdefs
Definition: pg_dump.h:320
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition: common.c:712
CatalogId catId
Definition: pg_dump.h:131
#define RELKIND_VIEW
Definition: pg_class.h:164
int i
int numParents
Definition: pg_dump.h:329
#define RELKIND_SEQUENCE
Definition: pg_class.h:162
DumpableObjectType objType
Definition: pg_dump.h:130
char * adef_expr
Definition: pg_dump.h:341
static void flagInhTables ( Archive fout,
TableInfo tbinfo,
int  numTables,
InhInfo inhinfo,
int  numInherits 
)
static

Definition at line 307 of file common.c.

References Archive::dopt, findParentsByOid(), i, _tableInfo::ispartition, _dumpOptions::load_via_partition_root, _tableInfo::numParents, numTables, _tableInfo::parents, RELKIND_MATVIEW, RELKIND_SEQUENCE, and RELKIND_VIEW.

Referenced by getSchemaData().

309 {
310  DumpOptions *dopt = fout->dopt;
311  int i,
312  j;
313 
314  for (i = 0; i < numTables; i++)
315  {
316  bool find_parents = true;
317  bool mark_parents = true;
318 
319  /* Some kinds never have parents */
320  if (tblinfo[i].relkind == RELKIND_SEQUENCE ||
321  tblinfo[i].relkind == RELKIND_VIEW ||
322  tblinfo[i].relkind == RELKIND_MATVIEW)
323  continue;
324 
325  /*
326  * Normally, we don't bother computing anything for non-target tables,
327  * but if load-via-partition-root is specified, we gather information
328  * on every partition in the system so that getRootTableInfo can trace
329  * from any given to leaf partition all the way up to the root. (We
330  * don't need to mark them as interesting for getTableAttrs, though.)
331  */
332  if (!tblinfo[i].dobj.dump)
333  {
334  mark_parents = false;
335 
336  if (!dopt->load_via_partition_root ||
337  !tblinfo[i].ispartition)
338  find_parents = false;
339  }
340 
341  /* If needed, find all the immediate parent tables. */
342  if (find_parents)
343  findParentsByOid(&tblinfo[i], inhinfo, numInherits);
344 
345  /* If needed, mark the parents as interesting for getTableAttrs. */
346  if (mark_parents)
347  {
348  int numParents = tblinfo[i].numParents;
349  TableInfo **parents = tblinfo[i].parents;
350 
351  for (j = 0; j < numParents; j++)
352  parents[j]->interesting = true;
353  }
354  }
355 }
struct _tableInfo ** parents
Definition: pg_dump.h:330
#define RELKIND_MATVIEW
Definition: pg_class.h:165
static void findParentsByOid(TableInfo *self, InhInfo *inhinfo, int numInherits)
Definition: common.c:912
static int numTables
Definition: common.c:57
DumpOptions * dopt
Definition: pg_backup.h:181
#define RELKIND_VIEW
Definition: pg_class.h:164
int i
#define RELKIND_SEQUENCE
Definition: pg_class.h:162
int load_via_partition_root
Definition: pg_backup.h:160
void getDumpableObjects ( DumpableObject ***  objs,
int *  numObjs 
)

Definition at line 690 of file common.c.

References allocedDumpIds, i, and pg_malloc().

Referenced by findObjectByCatalogId(), getTableDataFKConstraints(), and main().

691 {
692  int i,
693  j;
694 
695  *objs = (DumpableObject **)
697  j = 0;
698  for (i = 1; i < allocedDumpIds; i++)
699  {
700  if (dumpIdMap[i])
701  (*objs)[j++] = dumpIdMap[i];
702  }
703  *numObjs = j;
704 }
static int allocedDumpIds
Definition: common.c:32
static DumpableObject ** dumpIdMap
Definition: common.c:31
void * pg_malloc(size_t size)
Definition: fe_memutils.c:47
int i
DumpId getMaxDumpId ( void  )

Definition at line 529 of file common.c.

References lastDumpId.

Referenced by findDependencyLoops(), and TopoSort().

530 {
531  return lastDumpId;
532 }
static DumpId lastDumpId
Definition: common.c:33
TableInfo* getSchemaData ( Archive fout,
int *  numTablesPtr 
)

Definition at line 86 of file common.c.

References buildIndexArray(), Archive::dopt, flagInhAttrs(), flagInhTables(), g_verbose, getAccessMethods(), getAggregates(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getInherits(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getOwnedSeqs(), getPolicies(), getProcLangs(), getPublications(), getPublicationTables(), getRules(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), numCollations, numExtensions, numFuncs, numNamespaces, numOperators, numTables, numTypes, processExtensionTables(), and write_msg().

Referenced by main().

87 {
88  TableInfo *tblinfo;
90  FuncInfo *funinfo;
91  OprInfo *oprinfo;
92  CollInfo *collinfo;
93  NamespaceInfo *nspinfo;
94  ExtensionInfo *extinfo;
95  InhInfo *inhinfo;
96  int numAggregates;
97  int numInherits;
98  int numRules;
99  int numProcLangs;
100  int numCasts;
101  int numTransforms;
102  int numAccessMethods;
103  int numOpclasses;
104  int numOpfamilies;
105  int numConversions;
106  int numTSParsers;
107  int numTSTemplates;
108  int numTSDicts;
109  int numTSConfigs;
110  int numForeignDataWrappers;
111  int numForeignServers;
112  int numDefaultACLs;
113  int numEventTriggers;
114 
115  /*
116  * We must read extensions and extension membership info first, because
117  * extension membership needs to be consultable during decisions about
118  * whether other objects are to be dumped.
119  */
120  if (g_verbose)
121  write_msg(NULL, "reading extensions\n");
122  extinfo = getExtensions(fout, &numExtensions);
124 
125  if (g_verbose)
126  write_msg(NULL, "identifying extension members\n");
127  getExtensionMembership(fout, extinfo, numExtensions);
128 
129  if (g_verbose)
130  write_msg(NULL, "reading schemas\n");
131  nspinfo = getNamespaces(fout, &numNamespaces);
133 
134  /*
135  * getTables should be done as soon as possible, so as to minimize the
136  * window between starting our transaction and acquiring per-table locks.
137  * However, we have to do getNamespaces first because the tables get
138  * linked to their containing namespaces during getTables.
139  */
140  if (g_verbose)
141  write_msg(NULL, "reading user-defined tables\n");
142  tblinfo = getTables(fout, &numTables);
143  tblinfoindex = buildIndexArray(tblinfo, numTables, sizeof(TableInfo));
144 
145  /* Do this after we've built tblinfoindex */
146  getOwnedSeqs(fout, tblinfo, numTables);
147 
148  if (g_verbose)
149  write_msg(NULL, "reading user-defined functions\n");
150  funinfo = getFuncs(fout, &numFuncs);
151  funinfoindex = buildIndexArray(funinfo, numFuncs, sizeof(FuncInfo));
152 
153  /* this must be after getTables and getFuncs */
154  if (g_verbose)
155  write_msg(NULL, "reading user-defined types\n");
156  typinfo = getTypes(fout, &numTypes);
157  typinfoindex = buildIndexArray(typinfo, numTypes, sizeof(TypeInfo));
158 
159  /* this must be after getFuncs, too */
160  if (g_verbose)
161  write_msg(NULL, "reading procedural languages\n");
162  getProcLangs(fout, &numProcLangs);
163 
164  if (g_verbose)
165  write_msg(NULL, "reading user-defined aggregate functions\n");
166  getAggregates(fout, &numAggregates);
167 
168  if (g_verbose)
169  write_msg(NULL, "reading user-defined operators\n");
170  oprinfo = getOperators(fout, &numOperators);
171  oprinfoindex = buildIndexArray(oprinfo, numOperators, sizeof(OprInfo));
172 
173  if (g_verbose)
174  write_msg(NULL, "reading user-defined access methods\n");
175  getAccessMethods(fout, &numAccessMethods);
176 
177  if (g_verbose)
178  write_msg(NULL, "reading user-defined operator classes\n");
179  getOpclasses(fout, &numOpclasses);
180 
181  if (g_verbose)
182  write_msg(NULL, "reading user-defined operator families\n");
183  getOpfamilies(fout, &numOpfamilies);
184 
185  if (g_verbose)
186  write_msg(NULL, "reading user-defined text search parsers\n");
187  getTSParsers(fout, &numTSParsers);
188 
189  if (g_verbose)
190  write_msg(NULL, "reading user-defined text search templates\n");
191  getTSTemplates(fout, &numTSTemplates);
192 
193  if (g_verbose)
194  write_msg(NULL, "reading user-defined text search dictionaries\n");
195  getTSDictionaries(fout, &numTSDicts);
196 
197  if (g_verbose)
198  write_msg(NULL, "reading user-defined text search configurations\n");
199  getTSConfigurations(fout, &numTSConfigs);
200 
201  if (g_verbose)
202  write_msg(NULL, "reading user-defined foreign-data wrappers\n");
203  getForeignDataWrappers(fout, &numForeignDataWrappers);
204 
205  if (g_verbose)
206  write_msg(NULL, "reading user-defined foreign servers\n");
207  getForeignServers(fout, &numForeignServers);
208 
209  if (g_verbose)
210  write_msg(NULL, "reading default privileges\n");
211  getDefaultACLs(fout, &numDefaultACLs);
212 
213  if (g_verbose)
214  write_msg(NULL, "reading user-defined collations\n");
215  collinfo = getCollations(fout, &numCollations);
216  collinfoindex = buildIndexArray(collinfo, numCollations, sizeof(CollInfo));
217 
218  if (g_verbose)
219  write_msg(NULL, "reading user-defined conversions\n");
220  getConversions(fout, &numConversions);
221 
222  if (g_verbose)
223  write_msg(NULL, "reading type casts\n");
224  getCasts(fout, &numCasts);
225 
226  if (g_verbose)
227  write_msg(NULL, "reading transforms\n");
228  getTransforms(fout, &numTransforms);
229 
230  if (g_verbose)
231  write_msg(NULL, "reading table inheritance information\n");
232  inhinfo = getInherits(fout, &numInherits);
233 
234  if (g_verbose)
235  write_msg(NULL, "reading event triggers\n");
236  getEventTriggers(fout, &numEventTriggers);
237 
238  /* Identify extension configuration tables that should be dumped */
239  if (g_verbose)
240  write_msg(NULL, "finding extension tables\n");
241  processExtensionTables(fout, extinfo, numExtensions);
242 
243  /* Link tables to parents, mark parents of target tables interesting */
244  if (g_verbose)
245  write_msg(NULL, "finding inheritance relationships\n");
246  flagInhTables(fout, tblinfo, numTables, inhinfo, numInherits);
247 
248  if (g_verbose)
249  write_msg(NULL, "reading column info for interesting tables\n");
250  getTableAttrs(fout, tblinfo, numTables);
251 
252  if (g_verbose)
253  write_msg(NULL, "flagging inherited columns in subtables\n");
254  flagInhAttrs(fout->dopt, tblinfo, numTables);
255 
256  if (g_verbose)
257  write_msg(NULL, "reading indexes\n");
258  getIndexes(fout, tblinfo, numTables);
259 
260  if (g_verbose)
261  write_msg(NULL, "reading extended statistics\n");
262  getExtendedStatistics(fout, tblinfo, numTables);
263 
264  if (g_verbose)
265  write_msg(NULL, "reading constraints\n");
266  getConstraints(fout, tblinfo, numTables);
267 
268  if (g_verbose)
269  write_msg(NULL, "reading triggers\n");
270  getTriggers(fout, tblinfo, numTables);
271 
272  if (g_verbose)
273  write_msg(NULL, "reading rewrite rules\n");
274  getRules(fout, &numRules);
275 
276  if (g_verbose)
277  write_msg(NULL, "reading policies\n");
278  getPolicies(fout, tblinfo, numTables);
279 
280  if (g_verbose)
281  write_msg(NULL, "reading publications\n");
282  getPublications(fout);
283 
284  if (g_verbose)
285  write_msg(NULL, "reading publication membership\n");
286  getPublicationTables(fout, tblinfo, numTables);
287 
288  if (g_verbose)
289  write_msg(NULL, "reading subscriptions\n");
290  getSubscriptions(fout);
291 
292  *numTablesPtr = numTables;
293  return tblinfo;
294 }
FuncInfo * getFuncs(Archive *fout, int *numFuncs)
Definition: pg_dump.c:5333
static DumpableObject ** collinfoindex
Definition: common.c:54
static int numTypes
Definition: common.c:58
AggInfo * getAggregates(Archive *fout, int *numAggs)
Definition: pg_dump.c:5141
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3614
CollInfo * getCollations(Archive *fout, int *numCollations)
Definition: pg_dump.c:4740
OprInfo * getOperators(Archive *fout, int *numOprs)
Definition: pg_dump.c:4654
static DumpableObject ** oprinfoindex
Definition: common.c:53
TransformInfo * getTransforms(Archive *fout, int *numTransforms)
Definition: pg_dump.c:7733
DefaultACLInfo * getDefaultACLs(Archive *fout, int *numDefaultACLs)
Definition: pg_dump.c:8983
static void flagInhTables(Archive *fout, TableInfo *tbinfo, int numTables, InhInfo *inhinfo, int numInherits)
Definition: common.c:307
static int numFuncs
Definition: common.c:59
AccessMethodInfo * getAccessMethods(Archive *fout, int *numAccessMethods)
Definition: pg_dump.c:4899
OpclassInfo * getOpclasses(Archive *fout, int *numOpclasses)
Definition: pg_dump.c:4976
TSConfigInfo * getTSConfigurations(Archive *fout, int *numTSConfigs)
Definition: pg_dump.c:8581
static int numTables
Definition: common.c:57
static DumpableObject ** buildIndexArray(void *objArray, int numObjs, Size objSize)
Definition: common.c:647
TSParserInfo * getTSParsers(Archive *fout, int *numTSParsers)
Definition: pg_dump.c:8321
static DumpableObject ** typinfoindex
Definition: common.c:51
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6842
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition: pg_dump.c:6405
static int numOperators
Definition: common.c:60
DumpOptions * dopt
Definition: pg_backup.h:181
TableInfo * getTables(Archive *fout, int *numTables)
Definition: pg_dump.c:5567
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:3188
EventTriggerInfo * getEventTriggers(Archive *fout, int *numEventTriggers)
Definition: pg_dump.c:7342
static DumpableObject ** tblinfoindex
Definition: common.c:50
NamespaceInfo * getNamespaces(Archive *fout, int *numNamespaces)
Definition: pg_dump.c:4142
static int numExtensions
Definition: common.c:63
static int numNamespaces
Definition: common.c:62
RuleInfo * getRules(Archive *fout, int *numRules)
Definition: pg_dump.c:7026
FdwInfo * getForeignDataWrappers(Archive *fout, int *numForeignDataWrappers)
Definition: pg_dump.c:8661
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17296
void getSubscriptions(Archive *fout)
Definition: pg_dump.c:3763
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6459
TSDictInfo * getTSDictionaries(Archive *fout, int *numTSDicts)
Definition: pg_dump.c:8415
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:7142
void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
Definition: pg_dump.c:7833
void getExtendedStatistics(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6743
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition: pg_dump.c:6354
void write_msg(const char *modulename, const char *fmt,...)
ConvInfo * getConversions(Archive *fout, int *numConversions)
Definition: pg_dump.c:4823
OpfamilyInfo * getOpfamilies(Archive *fout, int *numOpfamilies)
Definition: pg_dump.c:5054
TSTemplateInfo * getTSTemplates(Archive *fout, int *numTSTemplates)
Definition: pg_dump.c:8502
static int numCollations
Definition: common.c:61
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition: pg_dump.c:4314
TypeInfo * getTypes(Archive *fout, int *numTypes)
Definition: pg_dump.c:4401
static DumpableObject ** extinfoindex
Definition: common.c:56
void getPublications(Archive *fout)
Definition: pg_dump.c:3451
ForeignServerInfo * getForeignServers(Archive *fout, int *numForeignServers)
Definition: pg_dump.c:8830
static DumpableObject ** funinfoindex
Definition: common.c:52
static DumpableObject ** nspinfoindex
Definition: common.c:55
ProcLangInfo * getProcLangs(Archive *fout, int *numProcLangs)
Definition: pg_dump.c:7436
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition: pg_dump.c:17188
static void flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo, int numTables)
Definition: common.c:370
bool g_verbose
Definition: pg_dump.c:91
CastInfo * getCasts(Archive *fout, int *numCasts)
Definition: pg_dump.c:7617
void parseOidArray ( const char *  str,
Oid array,
int  arraysize 
)

Definition at line 967 of file common.c.

References atooid, exit_nicely, InvalidOid, and write_msg().

Referenced by dumpFunc(), getAggregates(), getFuncs(), and getIndexes().

968 {
969  int j,
970  argNum;
971  char temp[100];
972  char s;
973 
974  argNum = 0;
975  j = 0;
976  for (;;)
977  {
978  s = *str++;
979  if (s == ' ' || s == '\0')
980  {
981  if (j > 0)
982  {
983  if (argNum >= arraysize)
984  {
985  write_msg(NULL, "could not parse numeric array \"%s\": too many numbers\n", str);
986  exit_nicely(1);
987  }
988  temp[j] = '\0';
989  array[argNum++] = atooid(temp);
990  j = 0;
991  }
992  if (s == '\0')
993  break;
994  }
995  else
996  {
997  if (!(isdigit((unsigned char) s) || s == '-') ||
998  j >= sizeof(temp) - 1)
999  {
1000  write_msg(NULL, "could not parse numeric array \"%s\": invalid character in number\n", str);
1001  exit_nicely(1);
1002  }
1003  temp[j++] = s;
1004  }
1005  }
1006 
1007  while (argNum < arraysize)
1008  array[argNum++] = InvalidOid;
1009 }
#define atooid(x)
Definition: postgres_ext.h:42
#define exit_nicely(code)
Definition: pg_dumpall.c:92
#define InvalidOid
Definition: postgres_ext.h:36
void write_msg(const char *modulename, const char *fmt,...)
void removeObjectDependency ( DumpableObject dobj,
DumpId  refId 
)

Definition at line 739 of file common.c.

References _dumpableObject::dependencies, i, and _dumpableObject::nDeps.

Referenced by repairDependencyLoop(), repairDomainConstraintLoop(), repairDomainConstraintMultiLoop(), repairMatViewBoundaryMultiLoop(), repairTableAttrDefLoop(), repairTableAttrDefMultiLoop(), repairTableConstraintLoop(), repairTableConstraintMultiLoop(), repairTypeFuncLoop(), repairViewRuleLoop(), and repairViewRuleMultiLoop().

740 {
741  int i;
742  int j = 0;
743 
744  for (i = 0; i < dobj->nDeps; i++)
745  {
746  if (dobj->dependencies[i] != refId)
747  dobj->dependencies[j++] = dobj->dependencies[i];
748  }
749  dobj->nDeps = j;
750 }
DumpId * dependencies
Definition: pg_dump.h:138
int i
void setExtensionMembership ( ExtensionMemberId extmems,
int  nextmems 
)

Definition at line 836 of file common.c.

References ExtensionMemberIdCompare(), numextmembers, and qsort.

Referenced by getExtensionMembership().

837 {
838  /* Sort array in preparation for binary searches */
839  if (nextmems > 1)
840  qsort((void *) extmems, nextmems, sizeof(ExtensionMemberId),
842  /* And save */
843  extmembers = extmems;
844  numextmembers = nextmems;
845 }
static int ExtensionMemberIdCompare(const void *p1, const void *p2)
Definition: common.c:890
static ExtensionMemberId * extmembers
Definition: common.c:66
static int numextmembers
Definition: common.c:67
#define qsort(a, b, c, d)
Definition: port.h:443
static int strInArray ( const char *  pattern,
char **  arr,
int  arr_size 
)
static

Definition at line 1020 of file common.c.

References i.

Referenced by flagInhAttrs().

1021 {
1022  int i;
1023 
1024  for (i = 0; i < arr_size; i++)
1025  {
1026  if (strcmp(pattern, arr[i]) == 0)
1027  return i;
1028  }
1029  return -1;
1030 }
int i

Variable Documentation

int allocedDumpIds = 0
static

Definition at line 32 of file common.c.

Referenced by AssignDumpId(), findObjectByDumpId(), and getDumpableObjects().

DumpableObject** catalogIdMap = NULL
static

Definition at line 39 of file common.c.

Referenced by findObjectByCatalogId().

bool catalogIdMapValid = false
static

Definition at line 38 of file common.c.

Referenced by AssignDumpId(), and findObjectByCatalogId().

DumpableObject** collinfoindex
static

Definition at line 54 of file common.c.

DumpableObject** dumpIdMap = NULL
static

Definition at line 31 of file common.c.

DumpableObject** extinfoindex
static

Definition at line 56 of file common.c.

ExtensionMemberId* extmembers
static

Definition at line 66 of file common.c.

Referenced by findOwningExtension(), and getExtensionMembership().

DumpableObject** funinfoindex
static

Definition at line 52 of file common.c.

DumpId lastDumpId = 0
static

Definition at line 33 of file common.c.

Referenced by AssignDumpId(), createDumpId(), and getMaxDumpId().

DumpableObject** nspinfoindex
static

Definition at line 55 of file common.c.

int numCatalogIds = 0
static

Definition at line 40 of file common.c.

Referenced by findObjectByCatalogId().

int numCollations
static

Definition at line 61 of file common.c.

Referenced by findCollationByOid(), and getSchemaData().

int numExtensions
static

Definition at line 63 of file common.c.

Referenced by findExtensionByOid(), getSchemaData(), and processExtensionTables().

int numextmembers
static

Definition at line 67 of file common.c.

Referenced by findOwningExtension(), and setExtensionMembership().

int numFuncs
static

Definition at line 59 of file common.c.

Referenced by findFuncByOid(), and getSchemaData().

int numNamespaces
static

Definition at line 62 of file common.c.

Referenced by findNamespaceByOid(), and getSchemaData().

int numOperators
static

Definition at line 60 of file common.c.

Referenced by findOprByOid(), and getSchemaData().

int numTypes
static

Definition at line 58 of file common.c.

Referenced by findTypeByOid(), and getSchemaData().

DumpableObject** oprinfoindex
static

Definition at line 53 of file common.c.

DumpableObject** tblinfoindex
static

Definition at line 50 of file common.c.

DumpableObject** typinfoindex
static

Definition at line 51 of file common.c.