src/bin/pg_dump/pg_dump.c
static const char *
fmtCopyColumnList(const TableInfo *ti, PQExpBuffer buffer)
{
	int			numatts = ti->numatts;
	char	  **attnames = ti->attnames;
	bool	   *attisdropped = ti->attisdropped;
	char	   *attgenerated = ti->attgenerated;
	bool		needComma;
	int			i;

	appendPQExpBufferChar(buffer, '(');
	needComma = false;
	for (i = 0; i < numatts; i++)
	{
		if (attisdropped[i])
			continue;
		if (attgenerated[i])
			continue;
		if (needComma)
			appendPQExpBufferStr(buffer, ", ");
		appendPQExpBufferStr(buffer, fmtId(attnames[i]));
		needComma = true;
	}

	if (!needComma)
		return "";				/* no undropped columns */

	appendPQExpBufferChar(buffer, ')');
	return buffer->data;
}
/*
 * Return a column list clause for the given relation.
 *
 * Special case: if there are no undropped columns in the relation, return
 * "", not an invalid "()" column list.
 */
Return a column list clause for the given relation.
Special case: if there are no undropped columns in the relation, return
"", not an invalid "()" column list.
Return a column list clause for the given relation . Special case : if there are no undropped columns in the relation return " " not an invalid " () " column list .
static const char *
fmtCopyColumnList(const TableInfo *ti, PQExpBuffer buffer)
{
	int			numatts = ti->numatts;
	char	  **attnames = ti->attnames;
	bool	   *attisdropped = ti->attisdropped;
	char	   *attgenerated = ti->attgenerated;
	bool		needComma;
	int			i;
	appendPQExpBufferChar(buffer, '(');
	needComma = false;
	for (i = 0; i < numatts; i++)
	{
		if (attisdropped[i])
			continue;
		if (attgenerated[i])
			continue;
		if (needComma)
			appendPQExpBufferStr(buffer, ", ");
		appendPQExpBufferStr(buffer, fmtId(attnames[i]));
		needComma = true;
	}
	if (!needComma)
		return "";				
	appendPQExpBufferChar(buffer, ')');
	return buffer->data;
}
static const char * fmtCopyColumnList ( const TableInfo * ti , PQExpBuffer buffer ) { int numatts = ti -> numatts ; char * * attnames = ti -> attnames ; bool * attisdropped = ti -> attisdropped ; char * attgenerated = ti -> attgenerated ; bool needComma ; int i ; appendPQExpBufferChar ( buffer , ' ' ) ; needComma = false ; for ( i = 0 ; i < numatts ; i ++ ) { if ( attisdropped [ i ] ) continue ; if ( attgenerated [ i ] ) continue ; if ( needComma ) appendPQExpBufferStr ( buffer , " " ) ; appendPQExpBufferStr ( buffer , fmtId ( attnames [ i ] ) ) ; needComma = true ; } if ( ! needComma ) return " " ; appendPQExpBufferChar ( buffer , ' ' ) ; return buffer -> data ; }
Return a column list clause for the given relation.
Return a column list clause for the given relation .
/* no undropped columns */