src/bin/pg_dump/pg_dump.c
static void
dumpTableConstraintComment(Archive *fout, const ConstraintInfo *coninfo)
{
	TableInfo  *tbinfo = coninfo->contable;
	PQExpBuffer conprefix = createPQExpBuffer();
	char	   *qtabname;

	qtabname = pg_strdup(fmtId(tbinfo->dobj.name));

	appendPQExpBuffer(conprefix, "CONSTRAINT %s ON",
					  fmtId(coninfo->dobj.name));

	if (coninfo->dobj.dump & DUMP_COMPONENT_COMMENT)
		dumpComment(fout, conprefix->data, qtabname,
					tbinfo->dobj.namespace->dobj.name,
					tbinfo->rolname,
					coninfo->dobj.catId, 0,
					coninfo->separate ? coninfo->dobj.dumpId : tbinfo->dobj.dumpId);

	destroyPQExpBuffer(conprefix);
	free(qtabname);
}
/*
 * dumpTableConstraintComment --- dump a constraint's comment if any
 *
 * This is split out because we need the function in two different places
 * depending on whether the constraint is dumped as part of CREATE TABLE
 * or as a separate ALTER command.
 */
dump a constraint's comment if any
This is split out because we need the function in two different places
depending on whether the constraint is dumped as part of CREATE TABLE
or as a separate ALTER command.
dump a constraint ' s comment if any This is split out because we need the function in two different places depending on whether the constraint is dumped as part of CREATE TABLE or as a separate ALTER command .
static void
dumpTableConstraintComment(Archive *fout, const ConstraintInfo *coninfo)
{
	TableInfo  *tbinfo = coninfo->contable;
	PQExpBuffer conprefix = createPQExpBuffer();
	char	   *qtabname;
	qtabname = pg_strdup(fmtId(tbinfo->dobj.name));
	appendPQExpBuffer(conprefix, "CONSTRAINT %s ON",
					  fmtId(coninfo->dobj.name));
	if (coninfo->dobj.dump & DUMP_COMPONENT_COMMENT)
		dumpComment(fout, conprefix->data, qtabname,
					tbinfo->dobj.namespace->dobj.name,
					tbinfo->rolname,
					coninfo->dobj.catId, 0,
					coninfo->separate ? coninfo->dobj.dumpId : tbinfo->dobj.dumpId);
	destroyPQExpBuffer(conprefix);
	free(qtabname);
}
static void dumpTableConstraintComment ( Archive * fout , const ConstraintInfo * coninfo ) { TableInfo * tbinfo = coninfo -> contable ; PQExpBuffer conprefix = createPQExpBuffer ( ) ; char * qtabname ; qtabname = pg_strdup ( fmtId ( tbinfo -> dobj . name ) ) ; appendPQExpBuffer ( conprefix , " " , fmtId ( coninfo -> dobj . name ) ) ; if ( coninfo -> dobj . dump & DUMP_COMPONENT_COMMENT ) dumpComment ( fout , conprefix -> data , qtabname , tbinfo -> dobj . namespace -> dobj . name , tbinfo -> rolname , coninfo -> dobj . catId , 0 , coninfo -> separate ? coninfo -> dobj . dumpId : tbinfo -> dobj . dumpId ) ; destroyPQExpBuffer ( conprefix ) ; free ( qtabname ) ; }
dumpTableConstraintComment --- dump a constraint's comment if any
 This is split out because we need the function in two different places
 depending on whether the constraint is dumped as part of CREATE TABLE
 or as a separate ALTER command.
dumpTableConstraintComment --- dump a constraint ' s comment if any This is split out because we need the function in two different places depending on whether the constraint is dumped as part of CREATE TABLE or as a separate ALTER command .