Skip to content

Commit 7969649

Browse files
committed
Minor tweak to avoid unnecessary memory bloat when dumping extremely wide
column values in -d mode. Per report from Marty Scholes. This doesn't completely solve the issue, because we still need multiple copies of the field value, but at least one copy can be got rid of painlessly ...
1 parent 4de12d4 commit 7969649

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.401 2005/01/23 00:30:26 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.402 2005/01/26 21:24:12 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -985,7 +985,7 @@ dumpTableData_insert(Archive *fout, void *dcontext)
985985
appendPQExpBuffer(q, fmtId(PQfname(res, field)));
986986
}
987987
appendPQExpBuffer(q, ") ");
988-
archprintf(fout, "%s", q->data);
988+
archputs(q->data, fout);
989989
}
990990
archprintf(fout, "VALUES (");
991991
for (field = 0; field < nfields; field++)
@@ -1047,7 +1047,7 @@ dumpTableData_insert(Archive *fout, void *dcontext)
10471047
/* All other types are printed as string literals. */
10481048
resetPQExpBuffer(q);
10491049
appendStringLiteral(q, PQgetvalue(res, tuple, field), false);
1050-
archprintf(fout, "%s", q->data);
1050+
archputs(q->data, fout);
10511051
break;
10521052
}
10531053
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy