PostgreSQL Source Code git master
Loading...
Searching...
No Matches
common.c File Reference
#include "postgres_fe.h"
#include <ctype.h>
#include "catalog/pg_am_d.h"
#include "catalog/pg_class_d.h"
#include "catalog/pg_collation_d.h"
#include "catalog/pg_extension_d.h"
#include "catalog/pg_namespace_d.h"
#include "catalog/pg_operator_d.h"
#include "catalog/pg_proc_d.h"
#include "catalog/pg_publication_d.h"
#include "catalog/pg_subscription_d.h"
#include "catalog/pg_type_d.h"
#include "common/hashfn.h"
#include "pg_backup_utils.h"
#include "pg_dump.h"
#include "lib/simplehash.h"
Include dependency graph for common.c:

Go to the source code of this file.

Data Structures

struct  _catalogIdMapEntry
 

Macros

#define SH_PREFIX   catalogid
 
#define SH_ELEMENT_TYPE   CatalogIdMapEntry
 
#define SH_KEY_TYPE   CatalogId
 
#define SH_KEY   catId
 
#define SH_HASH_KEY(tb, key)   hash_bytes((const unsigned char *) &(key), sizeof(CatalogId))
 
#define SH_EQUAL(tb, a, b)   ((a).oid == (b).oid && (a).tableoid == (b).tableoid)
 
#define SH_STORE_HASH
 
#define SH_GET_HASH(tb, a)   (a)->hashval
 
#define SH_SCOPE   static inline
 
#define SH_RAW_ALLOCATOR   pg_malloc0
 
#define SH_DECLARE
 
#define SH_DEFINE
 
#define CATALOGIDHASH_INITIAL_SIZE   10000
 

Typedefs

typedef struct _catalogIdMapEntry CatalogIdMapEntry
 

Functions

static void flagInhTables (Archive *fout, TableInfo *tblinfo, int numTables, InhInfo *inhinfo, int numInherits)
 
static void flagInhIndexes (Archive *fout, TableInfo *tblinfo, int numTables)
 
static void flagInhAttrs (Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTables)
 
static int strInArray (const char *pattern, char **arr, int arr_size)
 
static IndxInfofindIndexByOid (Oid oid)
 
TableInfogetSchemaData (Archive *fout, int *numTablesPtr)
 
static void flagInhIndexes (Archive *fout, TableInfo tblinfo[], int numTables)
 
void AssignDumpId (DumpableObject *dobj)
 
void recordAdditionalCatalogID (CatalogId catId, DumpableObject *dobj)
 
DumpId createDumpId (void)
 
DumpId getMaxDumpId (void)
 
DumpableObjectfindObjectByDumpId (DumpId dumpId)
 
DumpableObjectfindObjectByCatalogId (CatalogId catalogId)
 
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)
 
AccessMethodInfofindAccessMethodByOid (Oid oid)
 
CollInfofindCollationByOid (Oid oid)
 
NamespaceInfofindNamespaceByOid (Oid oid)
 
ExtensionInfofindExtensionByOid (Oid oid)
 
PublicationInfofindPublicationByOid (Oid oid)
 
SubscriptionInfofindSubscriptionByOid (Oid oid)
 
void recordExtensionMembership (CatalogId catId, ExtensionInfo *ext)
 
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 catalogid_hashcatalogIdHash = NULL
 

Macro Definition Documentation

◆ CATALOGIDHASH_INITIAL_SIZE

#define CATALOGIDHASH_INITIAL_SIZE   10000

Definition at line 80 of file common.c.

◆ SH_DECLARE

#define SH_DECLARE

Definition at line 76 of file common.c.

◆ SH_DEFINE

#define SH_DEFINE

Definition at line 77 of file common.c.

◆ SH_ELEMENT_TYPE

#define SH_ELEMENT_TYPE   CatalogIdMapEntry

Definition at line 67 of file common.c.

◆ SH_EQUAL

#define SH_EQUAL (   tb,
  a,
  b 
)    ((a).oid == (b).oid && (a).tableoid == (b).tableoid)

Definition at line 71 of file common.c.

◆ SH_GET_HASH

#define SH_GET_HASH (   tb,
  a 
)    (a)->hashval

Definition at line 73 of file common.c.

◆ SH_HASH_KEY

#define SH_HASH_KEY (   tb,
  key 
)    hash_bytes((const unsigned char *) &(key), sizeof(CatalogId))

Definition at line 70 of file common.c.

◆ SH_KEY

#define SH_KEY   catId

Definition at line 69 of file common.c.

◆ SH_KEY_TYPE

#define SH_KEY_TYPE   CatalogId

Definition at line 68 of file common.c.

◆ SH_PREFIX

#define SH_PREFIX   catalogid

Definition at line 66 of file common.c.

◆ SH_RAW_ALLOCATOR

#define SH_RAW_ALLOCATOR   pg_malloc0

Definition at line 75 of file common.c.

◆ SH_SCOPE

#define SH_SCOPE   static inline

Definition at line 74 of file common.c.

◆ SH_STORE_HASH

#define SH_STORE_HASH

Definition at line 72 of file common.c.

Typedef Documentation

◆ CatalogIdMapEntry

Function Documentation

◆ addObjectDependency()

void addObjectDependency ( DumpableObject dobj,
DumpId  refId 
)

Definition at line 821 of file common.c.

822{
823 if (dobj->nDeps >= dobj->allocDeps)
824 {
825 if (dobj->allocDeps <= 0)
826 {
827 dobj->allocDeps = 16;
829 }
830 else
831 {
832 dobj->allocDeps *= 2;
834 DumpId, dobj->allocDeps);
835 }
836 }
837 dobj->dependencies[dobj->nDeps++] = refId;
838}
#define pg_realloc_array(pointer, type, count)
Definition fe_memutils.h:74
#define pg_malloc_array(type, count)
Definition fe_memutils.h:66
int DumpId
Definition pg_backup.h:285
static int fb(int x)
DumpId * dependencies
Definition pg_dump.h:159

References _dumpableObject::allocDeps, _dumpableObject::dependencies, fb(), _dumpableObject::nDeps, pg_malloc_array, and pg_realloc_array.

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

◆ AssignDumpId()

void AssignDumpId ( DumpableObject dobj)

Definition at line 660 of file common.c.

661{
662 dobj->dumpId = ++lastDumpId;
663 dobj->name = NULL; /* must be set later */
664 dobj->namespace = NULL; /* may be set later */
665 dobj->dump = DUMP_COMPONENT_ALL; /* default assumption */
666 dobj->dump_contains = DUMP_COMPONENT_ALL; /* default assumption */
667 /* All objects have definitions; we may set more components bits later */
669 dobj->ext_member = false; /* default assumption */
670 dobj->depends_on_ext = false; /* default assumption */
671 dobj->dependencies = NULL;
672 dobj->nDeps = 0;
673 dobj->allocDeps = 0;
674
675 /* Add object to dumpIdMap[], enlarging that array if need be */
676 while (dobj->dumpId >= allocedDumpIds)
677 {
678 int newAlloc;
679
680 if (allocedDumpIds <= 0)
681 {
682 newAlloc = 256;
684 }
685 else
686 {
689 }
691 (newAlloc - allocedDumpIds) * sizeof(DumpableObject *));
693 }
694 dumpIdMap[dobj->dumpId] = dobj;
695
696 /* If it has a valid CatalogId, enter it into the hash table */
697 if (OidIsValid(dobj->catId.tableoid))
698 {
699 CatalogIdMapEntry *entry;
700 bool found;
701
702 /* Initialize CatalogId hash table if not done yet */
703 if (catalogIdHash == NULL)
705
706 entry = catalogid_insert(catalogIdHash, dobj->catId, &found);
707 if (!found)
708 {
709 entry->dobj = NULL;
710 entry->ext = NULL;
711 }
712 Assert(entry->dobj == NULL);
713 entry->dobj = dobj;
714 }
715}
static int allocedDumpIds
Definition common.c:38
static DumpableObject ** dumpIdMap
Definition common.c:37
#define CATALOGIDHASH_INITIAL_SIZE
Definition common.c:80
static catalogid_hash * catalogIdHash
Definition common.c:82
static DumpId lastDumpId
Definition common.c:39
#define Assert(condition)
Definition c.h:943
#define OidIsValid(objectId)
Definition c.h:858
#define DUMP_COMPONENT_ALL
Definition pg_dump.h:117
#define DUMP_COMPONENT_DEFINITION
Definition pg_dump.h:109
Oid tableoid
Definition pg_backup.h:281
ExtensionInfo * ext
Definition common.c:63
DumpableObject * dobj
Definition common.c:62
DumpComponents dump
Definition pg_dump.h:153
DumpId dumpId
Definition pg_dump.h:151
DumpComponents components
Definition pg_dump.h:156
CatalogId catId
Definition pg_dump.h:150
DumpComponents dump_contains
Definition pg_dump.h:155
bool depends_on_ext
Definition pg_dump.h:158

References _dumpableObject::allocDeps, allocedDumpIds, Assert, catalogIdHash, CATALOGIDHASH_INITIAL_SIZE, _dumpableObject::catId, _dumpableObject::components, _dumpableObject::dependencies, _dumpableObject::depends_on_ext, _catalogIdMapEntry::dobj, _dumpableObject::dump, DUMP_COMPONENT_ALL, DUMP_COMPONENT_DEFINITION, _dumpableObject::dump_contains, _dumpableObject::dumpId, dumpIdMap, _catalogIdMapEntry::ext, _dumpableObject::ext_member, fb(), lastDumpId, _dumpableObject::name, _dumpableObject::nDeps, OidIsValid, pg_malloc_array, pg_realloc_array, and CatalogId::tableoid.

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

◆ createDumpId()

◆ findAccessMethodByOid()

AccessMethodInfo * findAccessMethodByOid ( Oid  oid)

Definition at line 957 of file common.c.

958{
959 CatalogId catId;
960 DumpableObject *dobj;
961
963 catId.oid = oid;
964 dobj = findObjectByCatalogId(catId);
965 Assert(dobj == NULL || dobj->objType == DO_ACCESS_METHOD);
966 return (AccessMethodInfo *) dobj;
967}
DumpableObject * findObjectByCatalogId(CatalogId catalogId)
Definition common.c:781
@ DO_ACCESS_METHOD
Definition pg_dump.h:48
DumpableObjectType objType
Definition pg_dump.h:149

References Assert, DO_ACCESS_METHOD, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by accessMethodNameCompare().

◆ findCollationByOid()

CollInfo * findCollationByOid ( Oid  oid)

Definition at line 975 of file common.c.

976{
977 CatalogId catId;
978 DumpableObject *dobj;
979
981 catId.oid = oid;
982 dobj = findObjectByCatalogId(catId);
983 Assert(dobj == NULL || dobj->objType == DO_COLLATION);
984 return (CollInfo *) dobj;
985}
@ DO_COLLATION
Definition pg_dump.h:51

References Assert, DO_COLLATION, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

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

◆ findExtensionByOid()

ExtensionInfo * findExtensionByOid ( Oid  oid)

Definition at line 1011 of file common.c.

1012{
1013 CatalogId catId;
1014 DumpableObject *dobj;
1015
1017 catId.oid = oid;
1018 dobj = findObjectByCatalogId(catId);
1019 Assert(dobj == NULL || dobj->objType == DO_EXTENSION);
1020 return (ExtensionInfo *) dobj;
1021}
@ DO_EXTENSION
Definition pg_dump.h:42

References Assert, DO_EXTENSION, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by getExtensionMembership().

◆ findFuncByOid()

FuncInfo * findFuncByOid ( Oid  oid)

Definition at line 921 of file common.c.

922{
923 CatalogId catId;
924 DumpableObject *dobj;
925
927 catId.oid = oid;
928 dobj = findObjectByCatalogId(catId);
929 Assert(dobj == NULL || dobj->objType == DO_FUNC);
930 return (FuncInfo *) dobj;
931}
@ DO_FUNC
Definition pg_dump.h:45

References Assert, DO_FUNC, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

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

◆ findIndexByOid()

static IndxInfo * findIndexByOid ( Oid  oid)
static

Definition at line 884 of file common.c.

885{
886 CatalogId catId;
887 DumpableObject *dobj;
888
890 catId.oid = oid;
891 dobj = findObjectByCatalogId(catId);
892 Assert(dobj == NULL || dobj->objType == DO_INDEX);
893 return (IndxInfo *) dobj;
894}
@ DO_INDEX
Definition pg_dump.h:56

References Assert, DO_INDEX, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by flagInhIndexes().

◆ findNamespaceByOid()

NamespaceInfo * findNamespaceByOid ( Oid  oid)

Definition at line 993 of file common.c.

994{
995 CatalogId catId;
996 DumpableObject *dobj;
997
999 catId.oid = oid;
1000 dobj = findObjectByCatalogId(catId);
1001 Assert(dobj == NULL || dobj->objType == DO_NAMESPACE);
1002 return (NamespaceInfo *) dobj;
1003}
@ DO_NAMESPACE
Definition pg_dump.h:41

References Assert, DO_NAMESPACE, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by findNamespace(), and getPublicationNamespaces().

◆ findObjectByCatalogId()

◆ findObjectByDumpId()

DumpableObject * findObjectByDumpId ( DumpId  dumpId)

Definition at line 768 of file common.c.

769{
771 return NULL; /* out of range? */
772 return dumpIdMap[dumpId];
773}

References allocedDumpIds, dumpIdMap, and fb().

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

◆ findOprByOid()

OprInfo * findOprByOid ( Oid  oid)

Definition at line 939 of file common.c.

940{
941 CatalogId catId;
942 DumpableObject *dobj;
943
945 catId.oid = oid;
946 dobj = findObjectByCatalogId(catId);
947 Assert(dobj == NULL || dobj->objType == DO_OPERATOR);
948 return (OprInfo *) dobj;
949}
@ DO_OPERATOR
Definition pg_dump.h:47

References Assert, DO_OPERATOR, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by getFormattedOperatorName().

◆ findOwningExtension()

ExtensionInfo * findOwningExtension ( CatalogId  catalogId)

Definition at line 1090 of file common.c.

1091{
1092 CatalogIdMapEntry *entry;
1093
1094 if (catalogIdHash == NULL)
1095 return NULL; /* no objects exist yet */
1096
1097 entry = catalogid_lookup(catalogIdHash, catalogId);
1098 if (entry == NULL)
1099 return NULL;
1100 return entry->ext;
1101}

References catalogIdHash, _catalogIdMapEntry::ext, and fb().

Referenced by checkExtensionMembership().

◆ findPublicationByOid()

PublicationInfo * findPublicationByOid ( Oid  oid)

Definition at line 1029 of file common.c.

1030{
1031 CatalogId catId;
1032 DumpableObject *dobj;
1033
1035 catId.oid = oid;
1036 dobj = findObjectByCatalogId(catId);
1037 Assert(dobj == NULL || dobj->objType == DO_PUBLICATION);
1038 return (PublicationInfo *) dobj;
1039}
@ DO_PUBLICATION
Definition pg_dump.h:83

References Assert, DO_PUBLICATION, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by getPublicationNamespaces(), and getPublicationTables().

◆ findSubscriptionByOid()

SubscriptionInfo * findSubscriptionByOid ( Oid  oid)

Definition at line 1047 of file common.c.

1048{
1049 CatalogId catId;
1050 DumpableObject *dobj;
1051
1053 catId.oid = oid;
1054 dobj = findObjectByCatalogId(catId);
1055 Assert(dobj == NULL || dobj->objType == DO_SUBSCRIPTION);
1056 return (SubscriptionInfo *) dobj;
1057}
@ DO_SUBSCRIPTION
Definition pg_dump.h:87

References Assert, DO_SUBSCRIPTION, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by getSubscriptionRelations().

◆ findTableByOid()

◆ findTypeByOid()

TypeInfo * findTypeByOid ( Oid  oid)

Definition at line 902 of file common.c.

903{
904 CatalogId catId;
905 DumpableObject *dobj;
906
907 catId.tableoid = TypeRelationId;
908 catId.oid = oid;
909 dobj = findObjectByCatalogId(catId);
910 Assert(dobj == NULL ||
911 dobj->objType == DO_TYPE || dobj->objType == DO_DUMMY_TYPE);
912 return (TypeInfo *) dobj;
913}
@ DO_TYPE
Definition pg_dump.h:43
@ DO_DUMMY_TYPE
Definition pg_dump.h:67

References Assert, DO_DUMMY_TYPE, DO_TYPE, fb(), findObjectByCatalogId(), _dumpableObject::objType, CatalogId::oid, and CatalogId::tableoid.

Referenced by binary_upgrade_set_type_oids_by_type_oid(), collectComments(), collectSecLabels(), getCasts(), getFormattedTypeName(), getTransforms(), and pgTypeNameCompare().

◆ flagInhAttrs()

static void flagInhAttrs ( Archive fout,
DumpOptions dopt,
TableInfo tblinfo,
int  numTables 
)
static

Definition at line 480 of file common.c.

481{
482 int i,
483 j,
484 k;
485
486 /*
487 * We scan the tables in OID order, since that's how tblinfo[] is sorted.
488 * Hence we will typically visit parents before their children --- but
489 * that is *not* guaranteed. Thus this loop must be careful that it does
490 * not alter table properties in a way that could change decisions made at
491 * child tables during other iterations.
492 */
493 for (i = 0; i < numTables; i++)
494 {
495 TableInfo *tbinfo = &(tblinfo[i]);
496 int numParents;
497 TableInfo **parents;
498
499 /* Some kinds never have parents */
500 if (tbinfo->relkind == RELKIND_SEQUENCE ||
501 tbinfo->relkind == RELKIND_VIEW ||
502 tbinfo->relkind == RELKIND_MATVIEW ||
503 tbinfo->relkind == RELKIND_PROPGRAPH)
504 continue;
505
506 /* Don't bother computing anything for non-target tables, either */
507 if (!tbinfo->dobj.dump)
508 continue;
509
510 numParents = tbinfo->numParents;
511 parents = tbinfo->parents;
512
513 if (numParents == 0)
514 continue; /* nothing to see here, move along */
515
516 /* For each column, search for matching column names in parent(s) */
517 for (j = 0; j < tbinfo->numatts; j++)
518 {
519 bool foundNotNull; /* Attr was NOT NULL in a parent */
520 bool foundDefault; /* Found a default in a parent */
521 bool foundSameGenerated; /* Found matching GENERATED */
522 bool foundDiffGenerated; /* Found non-matching GENERATED */
523 bool allNotNullsInvalid = true; /* is NOT NULL NOT VALID
524 * on all parents? */
525
526 /* no point in examining dropped columns */
527 if (tbinfo->attisdropped[j])
528 continue;
529
530 foundNotNull = false;
531 foundDefault = false;
532 foundSameGenerated = false;
533 foundDiffGenerated = false;
534 for (k = 0; k < numParents; k++)
535 {
536 TableInfo *parent = parents[k];
537 int inhAttrInd;
538
539 inhAttrInd = strInArray(tbinfo->attnames[j],
540 parent->attnames,
541 parent->numatts);
542 if (inhAttrInd >= 0)
543 {
545
546 /*
547 * Account for each parent having a not-null constraint.
548 * In versions 18 and later, we don't need this (and those
549 * didn't have NO INHERIT.)
550 */
551 if (fout->remoteVersion < 180000 &&
552 parent->notnull_constrs[inhAttrInd] != NULL)
553 foundNotNull = true;
554
555 /*
556 * Keep track of whether all the parents that have a
557 * not-null constraint on this column have it as NOT
558 * VALID; if they all are, arrange to have it printed for
559 * this column. If at least one parent has it as valid,
560 * there's no need.
561 */
562 if (fout->remoteVersion >= 180000 &&
563 parent->notnull_constrs[inhAttrInd] &&
564 !parent->notnull_invalid[inhAttrInd])
565 allNotNullsInvalid = false;
566
567 foundDefault |= (parentDef != NULL &&
568 strcmp(parentDef->adef_expr, "NULL") != 0 &&
569 !parent->attgenerated[inhAttrInd]);
570 if (parent->attgenerated[inhAttrInd])
571 {
572 /* these pointer nullness checks are just paranoia */
573 if (parentDef != NULL &&
574 tbinfo->attrdefs[j] != NULL &&
575 strcmp(parentDef->adef_expr,
576 tbinfo->attrdefs[j]->adef_expr) == 0)
577 foundSameGenerated = true;
578 else
579 foundDiffGenerated = true;
580 }
581 }
582 }
583
584 /*
585 * In versions < 18, for lack of a better system, we arbitrarily
586 * decide that a not-null constraint is not locally defined if at
587 * least one of the parents has it.
588 */
589 if (fout->remoteVersion < 180000 && foundNotNull)
590 tbinfo->notnull_islocal[j] = false;
591
592 /*
593 * For versions >18, we must print the not-null constraint locally
594 * for this table even if it isn't really locally defined, but is
595 * valid for the child and no parent has it as valid.
596 */
597 if (fout->remoteVersion >= 180000 && allNotNullsInvalid)
598 tbinfo->notnull_islocal[j] = true;
599
600 /*
601 * Manufacture a DEFAULT NULL clause if necessary. This breaks
602 * the advice given above to avoid changing state that might get
603 * inspected in other loop iterations. We prevent trouble by
604 * having the foundDefault test above check whether adef_expr is
605 * "NULL", so that it will reach the same conclusion before or
606 * after this is done.
607 */
608 if (foundDefault && tbinfo->attrdefs[j] == NULL)
609 {
611
613 attrDef->dobj.objType = DO_ATTRDEF;
614 attrDef->dobj.catId.tableoid = 0;
615 attrDef->dobj.catId.oid = 0;
616 AssignDumpId(&attrDef->dobj);
617 attrDef->dobj.name = pg_strdup(tbinfo->dobj.name);
618 attrDef->dobj.namespace = tbinfo->dobj.namespace;
619 attrDef->dobj.dump = tbinfo->dobj.dump;
620
621 attrDef->adtable = tbinfo;
622 attrDef->adnum = j + 1;
623 attrDef->adef_expr = pg_strdup("NULL");
624
625 /* Will column be dumped explicitly? */
626 if (shouldPrintColumn(dopt, tbinfo, j))
627 {
628 attrDef->separate = false;
629 /* No dependency needed: NULL cannot have dependencies */
630 }
631 else
632 {
633 /* column will be suppressed, print default separately */
634 attrDef->separate = true;
635 /* ensure it comes out after the table */
637 tbinfo->dobj.dumpId);
638 }
639
640 tbinfo->attrdefs[j] = attrDef;
641 }
642
643 /* No need to dump generation expression if it's inheritable */
645 !tbinfo->ispartition && !dopt->binary_upgrade)
646 tbinfo->attrdefs[j]->dobj.dump = DUMP_COMPONENT_NONE;
647 }
648 }
649}
void addObjectDependency(DumpableObject *dobj, DumpId refId)
Definition common.c:821
void AssignDumpId(DumpableObject *dobj)
Definition common.c:660
static int strInArray(const char *pattern, char **arr, int arr_size)
Definition common.c:1161
char * pg_strdup(const char *in)
Definition fe_memutils.c:91
#define pg_malloc_object(type)
Definition fe_memutils.h:60
int j
Definition isn.c:78
int i
Definition isn.c:77
bool shouldPrintColumn(const DumpOptions *dopt, const TableInfo *tbinfo, int colno)
Definition pg_dump.c:10246
#define DUMP_COMPONENT_NONE
Definition pg_dump.h:108
@ DO_ATTRDEF
Definition pg_dump.h:55
static Archive * fout
Definition pg_dumpall.c:139
int remoteVersion
Definition pg_backup.h:234
int binary_upgrade
Definition pg_backup.h:175
bool * notnull_invalid
Definition pg_dump.h:376
char ** notnull_constrs
Definition pg_dump.h:371
int numParents
Definition pg_dump.h:347
struct _tableInfo ** parents
Definition pg_dump.h:348
char * attgenerated
Definition pg_dump.h:362
int numatts
Definition pg_dump.h:354
struct _attrDefInfo ** attrdefs
Definition pg_dump.h:379
char ** attnames
Definition pg_dump.h:355

References addObjectDependency(), AssignDumpId(), _tableInfo::attgenerated, _tableInfo::attnames, _tableInfo::attrdefs, _dumpOptions::binary_upgrade, DO_ATTRDEF, DUMP_COMPONENT_NONE, fb(), fout, i, j, _tableInfo::notnull_constrs, _tableInfo::notnull_invalid, _tableInfo::numatts, _tableInfo::numParents, _tableInfo::parents, pg_malloc_object, pg_strdup(), Archive::remoteVersion, shouldPrintColumn(), and strInArray().

Referenced by getSchemaData().

◆ flagInhIndexes() [1/2]

static void flagInhIndexes ( Archive fout,
TableInfo tblinfo,
int  numTables 
)
static

Referenced by getSchemaData().

◆ flagInhIndexes() [2/2]

static void flagInhIndexes ( Archive fout,
TableInfo  tblinfo[],
int  numTables 
)
static

Definition at line 388 of file common.c.

389{
390 int i,
391 j;
392
393 for (i = 0; i < numTables; i++)
394 {
395 if (!tblinfo[i].ispartition || tblinfo[i].numParents == 0)
396 continue;
397
398 Assert(tblinfo[i].numParents == 1);
399
400 for (j = 0; j < tblinfo[i].numIndexes; j++)
401 {
402 IndxInfo *index = &(tblinfo[i].indexes[j]);
403 IndxInfo *parentidx;
405
406 if (index->parentidx == 0)
407 continue;
408
409 parentidx = findIndexByOid(index->parentidx);
410 if (parentidx == NULL)
411 continue;
412
414
415 attachinfo->dobj.objType = DO_INDEX_ATTACH;
416 attachinfo->dobj.catId.tableoid = 0;
417 attachinfo->dobj.catId.oid = 0;
418 AssignDumpId(&attachinfo->dobj);
419 attachinfo->dobj.name = pg_strdup(index->dobj.name);
420 attachinfo->dobj.namespace = index->indextable->dobj.namespace;
421 attachinfo->parentIdx = parentidx;
422 attachinfo->partitionIdx = index;
423
424 /*
425 * We must state the DO_INDEX_ATTACH object's dependencies
426 * explicitly, since it will not match anything in pg_depend.
427 *
428 * Give it dependencies on both the partition index and the parent
429 * index, so that it will not be executed till both of those
430 * exist. (There's no need to care what order those are created
431 * in.)
432 *
433 * In addition, give it dependencies on the indexes' underlying
434 * tables. This does nothing of great value so far as serial
435 * restore ordering goes, but it ensures that a parallel restore
436 * will not try to run the ATTACH concurrently with other
437 * operations on those tables.
438 */
439 addObjectDependency(&attachinfo->dobj, index->dobj.dumpId);
440 addObjectDependency(&attachinfo->dobj, parentidx->dobj.dumpId);
442 index->indextable->dobj.dumpId);
444 parentidx->indextable->dobj.dumpId);
445
446 /* keep track of the list of partitions in the parent index */
448 }
449 }
450}
static IndxInfo * findIndexByOid(Oid oid)
Definition common.c:884
@ DO_INDEX_ATTACH
Definition pg_dump.h:57
void simple_ptr_list_append(SimplePtrList *list, void *ptr)
TableInfo * indextable
Definition pg_dump.h:421
SimplePtrList partattaches
Definition pg_dump.h:435
DumpableObject dobj
Definition pg_dump.h:420
struct _indxInfo * indexes
Definition pg_dump.h:389
DumpableObject dobj
Definition pg_dump.h:307
int numIndexes
Definition pg_dump.h:388
Definition type.h:97

References addObjectDependency(), Assert, AssignDumpId(), DO_INDEX_ATTACH, _tableInfo::dobj, _indxInfo::dobj, _dumpableObject::dumpId, fb(), findIndexByOid(), i, _tableInfo::indexes, _indxInfo::indextable, j, _tableInfo::numIndexes, _indxInfo::partattaches, pg_malloc_object, pg_strdup(), and simple_ptr_list_append().

◆ flagInhTables()

static void flagInhTables ( Archive fout,
TableInfo tblinfo,
int  numTables,
InhInfo inhinfo,
int  numInherits 
)
static

Definition at line 270 of file common.c.

272{
273 TableInfo *child = NULL;
274 TableInfo *parent = NULL;
275 int i,
276 j;
277
278 /*
279 * Set up links from child tables to their parents.
280 *
281 * We used to attempt to skip this work for tables that are not to be
282 * dumped; but the optimizable cases are rare in practice, and setting up
283 * these links in bulk is cheaper than the old way. (Note in particular
284 * that it's very rare for a child to have more than one parent.)
285 */
286 for (i = 0; i < numInherits; i++)
287 {
288 /*
289 * Skip a hashtable lookup if it's same table as last time. This is
290 * unlikely for the child, but less so for the parent. (Maybe we
291 * should ask the backend for a sorted array to make it more likely?
292 * Not clear the sorting effort would be repaid, though.)
293 */
294 if (child == NULL ||
295 child->dobj.catId.oid != inhinfo[i].inhrelid)
296 {
297 child = findTableByOid(inhinfo[i].inhrelid);
298
299 /*
300 * If we find no TableInfo, assume the pg_inherits entry is for a
301 * partitioned index, which we don't need to track.
302 */
303 if (child == NULL)
304 continue;
305 }
306 if (parent == NULL ||
307 parent->dobj.catId.oid != inhinfo[i].inhparent)
308 {
309 parent = findTableByOid(inhinfo[i].inhparent);
310 if (parent == NULL)
311 pg_fatal("failed sanity check, parent OID %u of table \"%s\" (OID %u) not found",
312 inhinfo[i].inhparent,
313 child->dobj.name,
314 child->dobj.catId.oid);
315 }
316 /* Add this parent to the child's list of parents. */
317 if (child->numParents > 0)
318 child->parents = pg_realloc_array(child->parents,
319 TableInfo *,
320 child->numParents + 1);
321 else
322 child->parents = pg_malloc_array(TableInfo *, 1);
323 child->parents[child->numParents++] = parent;
324 }
325
326 /*
327 * Now consider all child tables and mark parents interesting as needed.
328 */
329 for (i = 0; i < numTables; i++)
330 {
331 /*
332 * If needed, mark the parents as interesting for getTableAttrs and
333 * getIndexes. We only need this for direct parents of dumpable
334 * tables.
335 */
336 if (tblinfo[i].dobj.dump)
337 {
338 int numParents = tblinfo[i].numParents;
339 TableInfo **parents = tblinfo[i].parents;
340
341 for (j = 0; j < numParents; j++)
342 parents[j]->interesting = true;
343 }
344
345 /* Create TableAttachInfo object if needed */
346 if ((tblinfo[i].dobj.dump & DUMP_COMPONENT_DEFINITION) &&
347 tblinfo[i].ispartition)
348 {
350
351 /* With partitions there can only be one parent */
352 if (tblinfo[i].numParents != 1)
353 pg_fatal("invalid number of parents %d for table \"%s\"",
354 tblinfo[i].numParents,
355 tblinfo[i].dobj.name);
356
358 attachinfo->dobj.objType = DO_TABLE_ATTACH;
359 attachinfo->dobj.catId.tableoid = 0;
360 attachinfo->dobj.catId.oid = 0;
361 AssignDumpId(&attachinfo->dobj);
362 attachinfo->dobj.name = pg_strdup(tblinfo[i].dobj.name);
363 attachinfo->dobj.namespace = tblinfo[i].dobj.namespace;
364 attachinfo->parentTbl = tblinfo[i].parents[0];
365 attachinfo->partitionTbl = &tblinfo[i];
366
367 /*
368 * We must state the DO_TABLE_ATTACH object's dependencies
369 * explicitly, since it will not match anything in pg_depend.
370 *
371 * Give it dependencies on both the partition table and the parent
372 * table, so that it will not be executed till both of those
373 * exist. (There's no need to care what order those are created
374 * in.)
375 */
376 addObjectDependency(&attachinfo->dobj, tblinfo[i].dobj.dumpId);
377 addObjectDependency(&attachinfo->dobj, tblinfo[i].parents[0]->dobj.dumpId);
378 }
379 }
380}
TableInfo * findTableByOid(Oid oid)
Definition common.c:866
#define palloc_object(type)
Definition fe_memutils.h:89
#define pg_fatal(...)
@ DO_TABLE_ATTACH
Definition pg_dump.h:54

References addObjectDependency(), AssignDumpId(), _dumpableObject::catId, DO_TABLE_ATTACH, _tableInfo::dobj, DUMP_COMPONENT_DEFINITION, _dumpableObject::dumpId, fb(), findTableByOid(), i, _tableInfo::ispartition, j, _dumpableObject::name, _tableInfo::numParents, CatalogId::oid, palloc_object, _tableInfo::parents, pg_fatal, pg_malloc_array, pg_realloc_array, and pg_strdup().

Referenced by getSchemaData().

◆ getDumpableObjects()

void getDumpableObjects ( DumpableObject ***  objs,
int numObjs 
)

Definition at line 800 of file common.c.

801{
802 int i,
803 j;
804
806 j = 0;
807 for (i = 1; i < allocedDumpIds; i++)
808 {
809 if (dumpIdMap[i])
810 (*objs)[j++] = dumpIdMap[i];
811 }
812 *numObjs = j;
813}

References allocedDumpIds, dumpIdMap, fb(), i, j, and pg_malloc_array.

Referenced by getTableDataFKConstraints(), and main().

◆ getMaxDumpId()

DumpId getMaxDumpId ( void  )

Definition at line 757 of file common.c.

758{
759 return lastDumpId;
760}

References lastDumpId.

Referenced by findDependencyLoops(), and TopoSort().

◆ getSchemaData()

TableInfo * getSchemaData ( Archive fout,
int numTablesPtr 
)

Definition at line 98 of file common.c.

99{
100 TableInfo *tblinfo;
103 int numTables;
104 int numExtensions;
105 int numInherits;
106
107 /*
108 * We must read extensions and extension membership info first, because
109 * extension membership needs to be consultable during decisions about
110 * whether other objects are to be dumped.
111 */
112 pg_log_info("reading extensions");
114
115 pg_log_info("identifying extension members");
117
118 pg_log_info("reading schemas");
120
121 /*
122 * getTables should be done as soon as possible, so as to minimize the
123 * window between starting our transaction and acquiring per-table locks.
124 * However, we have to do getNamespaces first because the tables get
125 * linked to their containing namespaces during getTables.
126 */
127 pg_log_info("reading user-defined tables");
128 tblinfo = getTables(fout, &numTables);
129
130 getOwnedSeqs(fout, tblinfo, numTables);
131
132 pg_log_info("reading user-defined functions");
133 getFuncs(fout);
134
135 /* this must be after getTables and getFuncs */
136 pg_log_info("reading user-defined types");
137 getTypes(fout);
138
139 /* this must be after getFuncs, too */
140 pg_log_info("reading procedural languages");
142
143 pg_log_info("reading user-defined aggregate functions");
145
146 pg_log_info("reading user-defined operators");
148
149 pg_log_info("reading user-defined access methods");
151
152 pg_log_info("reading user-defined operator classes");
154
155 pg_log_info("reading user-defined operator families");
157
158 pg_log_info("reading user-defined text search parsers");
160
161 pg_log_info("reading user-defined text search templates");
163
164 pg_log_info("reading user-defined text search dictionaries");
166
167 pg_log_info("reading user-defined text search configurations");
169
170 pg_log_info("reading user-defined foreign-data wrappers");
172
173 pg_log_info("reading user-defined foreign servers");
175
176 pg_log_info("reading default privileges");
178
179 pg_log_info("reading user-defined collations");
181
182 pg_log_info("reading user-defined conversions");
184
185 pg_log_info("reading type casts");
186 getCasts(fout);
187
188 pg_log_info("reading transforms");
190
191 pg_log_info("reading table inheritance information");
193
194 pg_log_info("reading event triggers");
196
197 /* Identify extension configuration tables that should be dumped */
198 pg_log_info("finding extension tables");
200
201 /* Link tables to parents, mark parents of target tables interesting */
202 pg_log_info("finding inheritance relationships");
204
205 pg_log_info("reading column info for interesting tables");
206 getTableAttrs(fout, tblinfo, numTables);
207
208 pg_log_info("flagging inherited columns in subtables");
209 flagInhAttrs(fout, fout->dopt, tblinfo, numTables);
210
211 pg_log_info("reading partitioning data");
213
214 pg_log_info("reading indexes");
215 getIndexes(fout, tblinfo, numTables);
216
217 pg_log_info("flagging indexes in partitioned tables");
218 flagInhIndexes(fout, tblinfo, numTables);
219
220 pg_log_info("reading extended statistics");
222
223 pg_log_info("reading constraints");
224 getConstraints(fout, tblinfo, numTables);
225
226 pg_log_info("reading triggers");
227 getTriggers(fout, tblinfo, numTables);
228
229 pg_log_info("reading rewrite rules");
230 getRules(fout);
231
232 pg_log_info("reading policies");
233 getPolicies(fout, tblinfo, numTables);
234
235 pg_log_info("reading publications");
237
238 pg_log_info("reading publication membership of tables");
240
241 pg_log_info("reading publication membership of schemas");
243
244 pg_log_info("reading subscriptions");
246
247 pg_log_info("reading subscription membership of relations");
249
250 free(inhinfo); /* not needed any longer */
251
253 return tblinfo;
254}
static void flagInhAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTables)
Definition common.c:480
static void flagInhTables(Archive *fout, TableInfo *tblinfo, int numTables, InhInfo *inhinfo, int numInherits)
Definition common.c:270
static void flagInhIndexes(Archive *fout, TableInfo *tblinfo, int numTables)
#define pg_log_info(...)
Definition logging.h:126
void getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:8388
ExtensionInfo * getExtensions(Archive *fout, int *numExtensions)
Definition pg_dump.c:6215
void getPublicationNamespaces(Archive *fout)
Definition pg_dump.c:4804
void getPartitioningInfo(Archive *fout)
Definition pg_dump.c:7877
InhInfo * getInherits(Archive *fout, int *numInherits)
Definition pg_dump.c:7821
void getForeignDataWrappers(Archive *fout)
Definition pg_dump.c:10519
void getPolicies(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:4226
void getExtensionMembership(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition pg_dump.c:20195
void getTypes(Archive *fout)
Definition pg_dump.c:6290
void getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:7756
void getOpclasses(Archive *fout)
Definition pg_dump.c:6736
void getForeignServers(Archive *fout)
Definition pg_dump.c:10613
void getFuncs(Archive *fout)
Definition pg_dump.c:7005
void getTSDictionaries(Archive *fout)
Definition pg_dump.c:10335
void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:4884
void getCasts(Archive *fout)
Definition pg_dump.c:9137
void getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:7937
void getTSConfigurations(Archive *fout)
Definition pg_dump.c:10460
void getAccessMethods(Archive *fout)
Definition pg_dump.c:6662
void getConversions(Archive *fout)
Definition pg_dump.c:6600
void getRules(Archive *fout)
Definition pg_dump.c:8682
void getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
Definition pg_dump.c:9331
void getCollations(Archive *fout)
Definition pg_dump.c:6534
void getAggregates(Archive *fout)
Definition pg_dump.c:6864
void getNamespaces(Archive *fout)
Definition pg_dump.c:6083
void getPublications(Archive *fout)
Definition pg_dump.c:4516
void getTSParsers(Archive *fout)
Definition pg_dump.c:10261
TableInfo * getTables(Archive *fout, int *numTables)
Definition pg_dump.c:7278
void getExtendedStatistics(Archive *fout)
Definition pg_dump.c:8306
void processExtensionTables(Archive *fout, ExtensionInfo extinfo[], int numExtensions)
Definition pg_dump.c:20288
void getDefaultACLs(Archive *fout)
Definition pg_dump.c:10701
void getSubscriptions(Archive *fout)
Definition pg_dump.c:5159
void getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
Definition pg_dump.c:8779
void getTransforms(Archive *fout)
Definition pg_dump.c:9247
void getEventTriggers(Archive *fout)
Definition pg_dump.c:8975
void getTSTemplates(Archive *fout)
Definition pg_dump.c:10401
void getProcLangs(Archive *fout)
Definition pg_dump.c:9053
void getSubscriptionRelations(Archive *fout)
Definition pg_dump.c:5408
void getOperators(Archive *fout)
Definition pg_dump.c:6458
void getOpfamilies(Archive *fout)
Definition pg_dump.c:6799
#define free(a)
DumpOptions * dopt
Definition pg_backup.h:229

References Archive::dopt, fb(), flagInhAttrs(), flagInhIndexes(), flagInhTables(), fout, free, getAccessMethods(), getAggregates(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getInherits(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getOwnedSeqs(), getPartitioningInfo(), getPolicies(), getProcLangs(), getPublicationNamespaces(), getPublications(), getPublicationTables(), getRules(), getSubscriptionRelations(), getSubscriptions(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), pg_log_info, and processExtensionTables().

Referenced by main().

◆ parseOidArray()

void parseOidArray ( const char str,
Oid array,
int  arraysize 
)

Definition at line 1114 of file common.c.

1115{
1116 int j,
1117 argNum;
1118 char temp[100];
1119 char s;
1120
1121 argNum = 0;
1122 j = 0;
1123 for (;;)
1124 {
1125 s = *str++;
1126 if (s == ' ' || s == '\0')
1127 {
1128 if (j > 0)
1129 {
1130 if (argNum >= arraysize)
1131 pg_fatal("could not parse numeric array \"%s\": too many numbers", str);
1132 temp[j] = '\0';
1133 array[argNum++] = atooid(temp);
1134 j = 0;
1135 }
1136 if (s == '\0')
1137 break;
1138 }
1139 else
1140 {
1141 if (!(isdigit((unsigned char) s) || s == '-') ||
1142 j >= sizeof(temp) - 1)
1143 pg_fatal("could not parse numeric array \"%s\": invalid character in number", str);
1144 temp[j++] = s;
1145 }
1146 }
1147
1148 while (argNum < arraysize)
1149 array[argNum++] = InvalidOid;
1150}
const char * str
#define InvalidOid
#define atooid(x)

References atooid, fb(), InvalidOid, j, pg_fatal, and str.

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

◆ recordAdditionalCatalogID()

void recordAdditionalCatalogID ( CatalogId  catId,
DumpableObject dobj 
)

Definition at line 722 of file common.c.

723{
724 CatalogIdMapEntry *entry;
725 bool found;
726
727 /* CatalogId hash table must exist, if we have a DumpableObject */
729
730 /* Add reference to CatalogId hash */
731 entry = catalogid_insert(catalogIdHash, catId, &found);
732 if (!found)
733 {
734 entry->dobj = NULL;
735 entry->ext = NULL;
736 }
737 Assert(entry->dobj == NULL);
738 entry->dobj = dobj;
739}

References Assert, catalogIdHash, _catalogIdMapEntry::dobj, _catalogIdMapEntry::ext, and fb().

Referenced by getLOs().

◆ recordExtensionMembership()

void recordExtensionMembership ( CatalogId  catId,
ExtensionInfo ext 
)

Definition at line 1066 of file common.c.

1067{
1068 CatalogIdMapEntry *entry;
1069 bool found;
1070
1071 /* CatalogId hash table must exist, if we have an ExtensionInfo */
1073
1074 /* Add reference to CatalogId hash */
1075 entry = catalogid_insert(catalogIdHash, catId, &found);
1076 if (!found)
1077 {
1078 entry->dobj = NULL;
1079 entry->ext = NULL;
1080 }
1081 Assert(entry->ext == NULL);
1082 entry->ext = ext;
1083}

References Assert, catalogIdHash, _catalogIdMapEntry::dobj, _catalogIdMapEntry::ext, and fb().

Referenced by getExtensionMembership().

◆ removeObjectDependency()

◆ strInArray()

static int strInArray ( const char pattern,
char **  arr,
int  arr_size 
)
static

Definition at line 1161 of file common.c.

1162{
1163 int i;
1164
1165 for (i = 0; i < arr_size; i++)
1166 {
1167 if (strcmp(pattern, arr[i]) == 0)
1168 return i;
1169 }
1170 return -1;
1171}

References fb(), and i.

Referenced by flagInhAttrs().

Variable Documentation

◆ allocedDumpIds

int allocedDumpIds = 0
static

Definition at line 38 of file common.c.

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

◆ catalogIdHash

◆ dumpIdMap

DumpableObject** dumpIdMap = NULL
static

Definition at line 37 of file common.c.

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

◆ lastDumpId

DumpId lastDumpId = 0
static

Definition at line 39 of file common.c.

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