src/bin/pg_dump/pg_dump.c
static void
addBoundaryDependencies(DumpableObject **dobjs, int numObjs,
						DumpableObject *boundaryObjs)
{
	DumpableObject *preDataBound = boundaryObjs + 0;
	DumpableObject *postDataBound = boundaryObjs + 1;
	int			i;

	for (i = 0; i < numObjs; i++)
	{
		DumpableObject *dobj = dobjs[i];

		/*
		 * The classification of object types here must match the SECTION_xxx
		 * values assigned during subsequent ArchiveEntry calls!
		 */
		switch (dobj->objType)
		{
			case DO_NAMESPACE:
			case DO_EXTENSION:
			case DO_TYPE:
			case DO_SHELL_TYPE:
			case DO_FUNC:
			case DO_AGG:
			case DO_OPERATOR:
			case DO_ACCESS_METHOD:
			case DO_OPCLASS:
			case DO_OPFAMILY:
			case DO_COLLATION:
			case DO_CONVERSION:
			case DO_TABLE:
			case DO_TABLE_ATTACH:
			case DO_ATTRDEF:
			case DO_PROCLANG:
			case DO_CAST:
			case DO_DUMMY_TYPE:
			case DO_TSPARSER:
			case DO_TSDICT:
			case DO_TSTEMPLATE:
			case DO_TSCONFIG:
			case DO_FDW:
			case DO_FOREIGN_SERVER:
			case DO_TRANSFORM:
			case DO_BLOB:
				/* Pre-data objects: must come before the pre-data boundary */
				addObjectDependency(preDataBound, dobj->dumpId);
				break;
			case DO_TABLE_DATA:
			case DO_SEQUENCE_SET:
			case DO_BLOB_DATA:
				/* Data objects: must come between the boundaries */
				addObjectDependency(dobj, preDataBound->dumpId);
				addObjectDependency(postDataBound, dobj->dumpId);
				break;
			case DO_INDEX:
			case DO_INDEX_ATTACH:
			case DO_STATSEXT:
			case DO_REFRESH_MATVIEW:
			case DO_TRIGGER:
			case DO_EVENT_TRIGGER:
			case DO_DEFAULT_ACL:
			case DO_POLICY:
			case DO_PUBLICATION:
			case DO_PUBLICATION_REL:
			case DO_PUBLICATION_TABLE_IN_SCHEMA:
			case DO_SUBSCRIPTION:
				/* Post-data objects: must come after the post-data boundary */
				addObjectDependency(dobj, postDataBound->dumpId);
				break;
			case DO_RULE:
				/* Rules are post-data, but only if dumped separately */
				if (((RuleInfo *) dobj)->separate)
					addObjectDependency(dobj, postDataBound->dumpId);
				break;
			case DO_CONSTRAINT:
			case DO_FK_CONSTRAINT:
				/* Constraints are post-data, but only if dumped separately */
				if (((ConstraintInfo *) dobj)->separate)
					addObjectDependency(dobj, postDataBound->dumpId);
				break;
			case DO_PRE_DATA_BOUNDARY:
				/* nothing to do */
				break;
			case DO_POST_DATA_BOUNDARY:
				/* must come after the pre-data boundary */
				addObjectDependency(dobj, preDataBound->dumpId);
				break;
		}
	}
}
/*
 * addBoundaryDependencies - add dependencies as needed to enforce the dump
 * section boundaries.
 */
add dependencies as needed to enforce the dump
section boundaries.
add dependencies as needed to enforce the dump section boundaries .
static void
addBoundaryDependencies(DumpableObject **dobjs, int numObjs,
						DumpableObject *boundaryObjs)
{
	DumpableObject *preDataBound = boundaryObjs + 0;
	DumpableObject *postDataBound = boundaryObjs + 1;
	int			i;
	for (i = 0; i < numObjs; i++)
	{
		DumpableObject *dobj = dobjs[i];
		switch (dobj->objType)
		{
			case DO_NAMESPACE:
			case DO_EXTENSION:
			case DO_TYPE:
			case DO_SHELL_TYPE:
			case DO_FUNC:
			case DO_AGG:
			case DO_OPERATOR:
			case DO_ACCESS_METHOD:
			case DO_OPCLASS:
			case DO_OPFAMILY:
			case DO_COLLATION:
			case DO_CONVERSION:
			case DO_TABLE:
			case DO_TABLE_ATTACH:
			case DO_ATTRDEF:
			case DO_PROCLANG:
			case DO_CAST:
			case DO_DUMMY_TYPE:
			case DO_TSPARSER:
			case DO_TSDICT:
			case DO_TSTEMPLATE:
			case DO_TSCONFIG:
			case DO_FDW:
			case DO_FOREIGN_SERVER:
			case DO_TRANSFORM:
			case DO_BLOB:
				addObjectDependency(preDataBound, dobj->dumpId);
				break;
			case DO_TABLE_DATA:
			case DO_SEQUENCE_SET:
			case DO_BLOB_DATA:
				addObjectDependency(dobj, preDataBound->dumpId);
				addObjectDependency(postDataBound, dobj->dumpId);
				break;
			case DO_INDEX:
			case DO_INDEX_ATTACH:
			case DO_STATSEXT:
			case DO_REFRESH_MATVIEW:
			case DO_TRIGGER:
			case DO_EVENT_TRIGGER:
			case DO_DEFAULT_ACL:
			case DO_POLICY:
			case DO_PUBLICATION:
			case DO_PUBLICATION_REL:
			case DO_PUBLICATION_TABLE_IN_SCHEMA:
			case DO_SUBSCRIPTION:
				addObjectDependency(dobj, postDataBound->dumpId);
				break;
			case DO_RULE:
				if (((RuleInfo *) dobj)->separate)
					addObjectDependency(dobj, postDataBound->dumpId);
				break;
			case DO_CONSTRAINT:
			case DO_FK_CONSTRAINT:
				if (((ConstraintInfo *) dobj)->separate)
					addObjectDependency(dobj, postDataBound->dumpId);
				break;
			case DO_PRE_DATA_BOUNDARY:
				break;
			case DO_POST_DATA_BOUNDARY:
				addObjectDependency(dobj, preDataBound->dumpId);
				break;
		}
	}
}
static void addBoundaryDependencies ( DumpableObject * * dobjs , int numObjs , DumpableObject * boundaryObjs ) { DumpableObject * preDataBound = boundaryObjs + 0 ; DumpableObject * postDataBound = boundaryObjs + 1 ; int i ; for ( i = 0 ; i < numObjs ; i ++ ) { DumpableObject * dobj = dobjs [ i ] ; switch ( dobj -> objType ) { case DO_NAMESPACE : case DO_EXTENSION : case DO_TYPE : case DO_SHELL_TYPE : case DO_FUNC : case DO_AGG : case DO_OPERATOR : case DO_ACCESS_METHOD : case DO_OPCLASS : case DO_OPFAMILY : case DO_COLLATION : case DO_CONVERSION : case DO_TABLE : case DO_TABLE_ATTACH : case DO_ATTRDEF : case DO_PROCLANG : case DO_CAST : case DO_DUMMY_TYPE : case DO_TSPARSER : case DO_TSDICT : case DO_TSTEMPLATE : case DO_TSCONFIG : case DO_FDW : case DO_FOREIGN_SERVER : case DO_TRANSFORM : case DO_BLOB : addObjectDependency ( preDataBound , dobj -> dumpId ) ; break ; case DO_TABLE_DATA : case DO_SEQUENCE_SET : case DO_BLOB_DATA : addObjectDependency ( dobj , preDataBound -> dumpId ) ; addObjectDependency ( postDataBound , dobj -> dumpId ) ; break ; case DO_INDEX : case DO_INDEX_ATTACH : case DO_STATSEXT : case DO_REFRESH_MATVIEW : case DO_TRIGGER : case DO_EVENT_TRIGGER : case DO_DEFAULT_ACL : case DO_POLICY : case DO_PUBLICATION : case DO_PUBLICATION_REL : case DO_PUBLICATION_TABLE_IN_SCHEMA : case DO_SUBSCRIPTION : addObjectDependency ( dobj , postDataBound -> dumpId ) ; break ; case DO_RULE : if ( ( ( RuleInfo * ) dobj ) -> separate ) addObjectDependency ( dobj , postDataBound -> dumpId ) ; break ; case DO_CONSTRAINT : case DO_FK_CONSTRAINT : if ( ( ( ConstraintInfo * ) dobj ) -> separate ) addObjectDependency ( dobj , postDataBound -> dumpId ) ; break ; case DO_PRE_DATA_BOUNDARY : break ; case DO_POST_DATA_BOUNDARY : addObjectDependency ( dobj , preDataBound -> dumpId ) ; break ; } } }
addBoundaryDependencies - add dependencies as needed to enforce the dump
 section boundaries.
addBoundaryDependencies - add dependencies as needed to enforce the dump section boundaries .
/*
		 * The classification of object types here must match the SECTION_xxx
		 * values assigned during subsequent ArchiveEntry calls!
		 */ /* Pre-data objects: must come before the pre-data boundary */ /* Data objects: must come between the boundaries */ /* Post-data objects: must come after the post-data boundary */ /* Rules are post-data, but only if dumped separately */ /* Constraints are post-data, but only if dumped separately */ /* nothing to do */ /* must come after the pre-data boundary */