diff options
| author | Bruce Momjian <bruce@momjian.us> | 2004-08-08 06:44:36 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2004-08-08 06:44:36 +0000 |
| commit | 7ee3c351522694dc6f8f0d6578394bdf5dec0b59 (patch) | |
| tree | ca89b755bf06e58f99c44a2dee918b6c4bc23038 /src/bin/pg_dump/pg_dumpall.c | |
| parent | 881ea47d248069a9597c292ca76891a67b1a6d6f (diff) | |
| download | postgresql-7ee3c351522694dc6f8f0d6578394bdf5dec0b59.tar.gz | |
Allow libpgport to call memory allocation routines even though
CurrentMemoryContext is DLLIMPORT on Win32. Work around that by
creating stubs in the backend for palloc/pstrdup.
Also fix pg_dumpall to do proper quoting on Win32.
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
| -rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index d260f2c0b2..a79cf836b2 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.46 2004/08/04 21:34:12 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.47 2004/08/08 06:44:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -840,21 +840,39 @@ runPgDump(const char *dbname) const char *p; int ret; + /* + * Win32 has to use double-quotes for args, rather than single quotes. + * Strangely enough, this is the only place we pass a database name + * on the command line, except template1 that doesn't need quoting. + */ +#ifndef WIN32 appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp '", SYSTEMQUOTE, pg_dump_bin, +#else + appendPQExpBuffer(cmd, "%s\"%s\" %s -Fp \"", SYSTEMQUOTE, pg_dump_bin, +#endif pgdumpopts->data); /* Shell quoting is not quite like SQL quoting, so can't use fmtId */ for (p = dbname; *p; p++) { +#ifndef WIN32 if (*p == '\'') appendPQExpBuffer(cmd, "'\"'\"'"); else +#endif + /* not needed on Win32 */ appendPQExpBufferChar(cmd, *p); } +#ifndef WIN32 appendPQExpBufferChar(cmd, '\''); - appendStringLiteral(cmd, SYSTEMQUOTE, false); +#else + appendPQExpBufferChar(cmd, '"'); +#endif + if (strlen(SYSTEMQUOTE) > 0) + appendPQExpBuffer(cmd, SYSTEMQUOTE); + if (verbose) fprintf(stderr, _("%s: running \"%s\"\n"), progname, cmd->data); |
