1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Revert addition of poorly-thought-out DUMP TIMESTAMP archive entry,

which induced bug #1597 in addition to having several other misbehaviors
(like labeling the dump with a completion time having nothing to do with
reality).  Instead just print out the desired strings where RestoreArchive
was already emitting the 'PostgreSQL database dump' and
'PostgreSQL database dump complete' strings.
This commit is contained in:
Tom Lane
2005-04-15 16:40:36 +00:00
parent 3fa7901070
commit 348f856dc5
2 changed files with 32 additions and 53 deletions

View File

@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.406 2005/04/12 04:26:27 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.407 2005/04/15 16:40:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -32,7 +32,6 @@
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#include <time.h>
#ifndef HAVE_STRDUP
#include "strdup.h"
@@ -166,7 +165,6 @@ static char *myFormatType(const char *typname, int32 typmod);
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);
@@ -603,9 +601,6 @@ main(int argc, char **argv)
* safe order.
*/
if (g_fout->verbose)
dumpTimestamp(g_fout, "Started on");
/* First the special encoding entry. */
dumpEncoding(g_fout);
@@ -621,9 +616,6 @@ main(int argc, char **argv)
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.
*/
@@ -638,6 +630,7 @@ main(int argc, char **argv)
ropt->noOwner = outputNoOwner;
ropt->disable_triggers = disable_triggers;
ropt->use_setsessauth = use_setsessauth;
ropt->dataOnly = dataOnly;
if (compressLevel == -1)
ropt->compression = 0;
@@ -1300,35 +1293,6 @@ dumpDatabase(Archive *AH)
}
/*
* 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
*/