#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
-#include <time.h>
#ifndef HAVE_STRDUP
#include "strdup.h"
static const char *fmtQualifiedId(const char *schema, const char *id);
static int dumpBlobs(Archive *AH, void *arg);
static void dumpDatabase(Archive *AH);
-static void dumpTimestamp(Archive *AH, char *msg);
static void dumpEncoding(Archive *AH);
static const char *getAttrName(int attrnum, TableInfo *tblInfo);
static const char *fmtCopyColumnList(const TableInfo *ti);
* safe order.
*/
- if (g_fout->verbose)
- dumpTimestamp(g_fout, "Started on");
-
/* First the special encoding entry. */
dumpEncoding(g_fout);
for (i = 0; i < numObjs; i++)
dumpDumpableObject(g_fout, dobjs[i]);
- if (g_fout->verbose)
- dumpTimestamp(g_fout, "Completed on");
-
/*
* And finally we can do the actual output.
*/
ropt->noOwner = outputNoOwner;
ropt->disable_triggers = disable_triggers;
ropt->use_setsessauth = use_setsessauth;
+ ropt->dataOnly = dataOnly;
if (compressLevel == -1)
ropt->compression = 0;
{
if (field > 0)
appendPQExpBuffer(q, ", ");
- appendPQExpBuffer(q, fmtId(PQfname(res, field)));
+ appendPQExpBufferStr(q, fmtId(PQfname(res, field)));
}
appendPQExpBuffer(q, ") ");
- archprintf(fout, "%s", q->data);
+ archputs(q->data, fout);
}
archprintf(fout, "VALUES (");
for (field = 0; field < nfields; field++)
/* All other types are printed as string literals. */
resetPQExpBuffer(q);
appendStringLiteral(q, PQgetvalue(res, tuple, field), false);
- archprintf(fout, "%s", q->data);
+ archputs(q->data, fout);
break;
}
}
}
-/*
- * dumpTimestamp
- */
-static void
-dumpTimestamp(Archive *AH, char *msg)
-{
- char buf[256];
- time_t now = time(NULL);
-
- if (strftime(buf, 256, "%Y-%m-%d %H:%M:%S %Z", localtime(&now)) != 0)
- {
- PQExpBuffer qry = createPQExpBuffer();
-
- appendPQExpBuffer(qry, "-- ");
- appendPQExpBuffer(qry, msg);
- appendPQExpBuffer(qry, " ");
- appendPQExpBuffer(qry, buf);
- appendPQExpBuffer(qry, "\n");
-
- ArchiveEntry(AH, nilCatalogId, createDumpId(),
- "DUMP TIMESTAMP", NULL, NULL, "",
- false, "DUMP TIMESTAMP", qry->data, "", NULL,
- NULL, 0,
- NULL, NULL);
- destroyPQExpBuffer(qry);
- }
-}
-
-
/*
* dumpEncoding: put the correct encoding into the archive
*/
{
appendPQExpBuffer(query,
"SELECT proretset, prosrc, probin, "
- "null::text as proargnames, "
+ "null as proargnames, "
"provolatile, proisstrict, prosecdef, "
"(SELECT lanname FROM pg_catalog.pg_language WHERE oid = prolang) as lanname "
"FROM pg_catalog.pg_proc "
{
appendPQExpBuffer(query,
"SELECT proretset, prosrc, probin, "
- "null::text as proargnames, "
+ "null as proargnames, "
"case when proiscachable then 'i' else 'v' end as provolatile, "
"proisstrict, "
"'f'::boolean as prosecdef, "
{
appendPQExpBuffer(query,
"SELECT proretset, prosrc, probin, "
- "null::text as proargnames, "
+ "null as proargnames, "
"case when proiscachable then 'i' else 'v' end as provolatile, "
"'f'::boolean as proisstrict, "
"'f'::boolean as prosecdef, "
ArchiveEntry(fout, indxinfo->dobj.catId, indxinfo->dobj.dumpId,
indxinfo->dobj.name,
tbinfo->dobj.namespace->dobj.name,
- tbinfo->reltablespace,
+ indxinfo->tablespace,
tbinfo->usename, false,
"INDEX", q->data, delq->data, NULL,
indxinfo->dobj.dependencies, indxinfo->dobj.nDeps,
if (tginfo->tgisconstraint)
{
appendPQExpBuffer(query, "CREATE CONSTRAINT TRIGGER ");
- appendPQExpBuffer(query, fmtId(tginfo->tgconstrname));
+ appendPQExpBufferStr(query, fmtId(tginfo->tgconstrname));
}
else
{
appendPQExpBuffer(query, "CREATE TRIGGER ");
- appendPQExpBuffer(query, fmtId(tginfo->dobj.name));
+ appendPQExpBufferStr(query, fmtId(tginfo->dobj.name));
}
appendPQExpBuffer(query, "\n ");