Index: doc/src/sgml/ref/pg_dump.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/pg_dump.sgml,v
retrieving revision 1.70
diff -c -c -r1.70 pg_dump.sgml
*** doc/src/sgml/ref/pg_dump.sgml 31 May 2004 13:37:52 -0000 1.70
--- doc/src/sgml/ref/pg_dump.sgml 5 Jun 2004 04:22:15 -0000
***************
*** 403,409 ****
Specifies verbose mode. This will cause
pg_dump to output detailed object
! comments in the dump file, and progress messages to standard error.
--- 403,410 ----
Specifies verbose mode. This will cause
pg_dump to output detailed object
! comments in the dump file, start and stop times, and progress
! messages to standard error.
Index: doc/src/sgml/ref/pg_dumpall.sgml
===================================================================
RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/pg_dumpall.sgml,v
retrieving revision 1.43
diff -c -c -r1.43 pg_dumpall.sgml
*** doc/src/sgml/ref/pg_dumpall.sgml 29 Nov 2003 19:51:39 -0000 1.43
--- doc/src/sgml/ref/pg_dumpall.sgml 5 Jun 2004 04:22:15 -0000
***************
*** 192,199 ****
Specifies verbose mode. This will cause
! pg_dumpall to print progress
! messages to standard error.
--- 192,200 ----
Specifies verbose mode. This will cause
! pg_dumpall to output start and stop
! times in the dump file, and progress messages to standard error.
! It will also enable verbose output in pg_dump>.
Index: src/bin/pg_dump/pg_dump.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.373
diff -c -c -r1.373 pg_dump.c
*** src/bin/pg_dump/pg_dump.c 3 Jun 2004 00:07:36 -0000 1.373
--- src/bin/pg_dump/pg_dump.c 5 Jun 2004 04:22:21 -0000
***************
*** 32,37 ****
--- 32,38 ----
#ifdef HAVE_TERMIOS_H
#include
#endif
+ #include
#ifndef HAVE_STRDUP
#include "strdup.h"
***************
*** 163,168 ****
--- 164,170 ----
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);
***************
*** 598,603 ****
--- 600,608 ----
* in a safe order.
*/
+ if (g_fout->verbose)
+ dumpTimestamp(g_fout, "Started on");
+
/* First the special encoding entry. */
dumpEncoding(g_fout);
***************
*** 615,620 ****
--- 620,628 ----
dumpDumpableObject(g_fout, dobjs[i]);
}
+ if (g_fout->verbose)
+ dumpTimestamp(g_fout, "Completed on");
+
/*
* And finally we can do the actual output.
*/
***************
*** 1280,1285 ****
--- 1288,1322 ----
destroyPQExpBuffer(dbQry);
destroyPQExpBuffer(delQry);
destroyPQExpBuffer(creaQry);
+ }
+
+
+ /*
+ * 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, "",
+ false, "DUMP TIMESTAMP", qry->data, "", NULL,
+ NULL, 0,
+ NULL, NULL);
+ destroyPQExpBuffer(qry);
+ }
}