Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
91366138
Commit
91366138
authored
Jun 07, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add start/stop times for pg_dump/pg_dumpall when verbose output is used.
parent
e25a6e18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
7 deletions
+66
-7
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_dump.sgml
+3
-2
doc/src/sgml/ref/pg_dumpall.sgml
doc/src/sgml/ref/pg_dumpall.sgml
+4
-3
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+38
-1
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+21
-1
No files found.
doc/src/sgml/ref/pg_dump.sgml
View file @
91366138
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.7
0 2004/05/31 13:37:52
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.7
1 2004/06/07 20:35:57
momjian Exp $
PostgreSQL documentation
-->
...
...
@@ -403,7 +403,8 @@ PostgreSQL documentation
<para>
Specifies verbose mode. This will cause
<application>pg_dump</application> to output detailed object
comments in the dump file, and progress messages to standard error.
comments and start/stop times to the dump file, and progress
messages to standard error.
</para>
</listitem>
</varlistentry>
...
...
doc/src/sgml/ref/pg_dumpall.sgml
View file @
91366138
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.4
3 2003/11/29 19:51:39 pgsql
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.4
4 2004/06/07 20:35:57 momjian
Exp $
PostgreSQL documentation
-->
...
...
@@ -192,8 +192,9 @@ PostgreSQL documentation
<listitem>
<para>
Specifies verbose mode. This will cause
<application>pg_dumpall</application> to print progress
messages to standard error.
<application>pg_dumpall</application> to output start/stop
times to the dump file, and progress messages to standard error.
It will also enable verbose output in <application>pg_dump</>.
</para>
</listitem>
</varlistentry>
...
...
src/bin/pg_dump/pg_dump.c
View file @
91366138
...
...
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.37
3 2004/06/03 00:07:36
momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.37
4 2004/06/07 20:35:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -32,6 +32,7 @@
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#include <time.h>
#ifndef HAVE_STRDUP
#include "strdup.h"
...
...
@@ -163,6 +164,7 @@ 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
);
...
...
@@ -598,6 +600,9 @@ main(int argc, char **argv)
* in a safe order.
*/
if
(
g_fout
->
verbose
)
dumpTimestamp
(
g_fout
,
"Started on"
);
/* First the special encoding entry. */
dumpEncoding
(
g_fout
);
...
...
@@ -615,6 +620,9 @@ main(int argc, char **argv)
dumpDumpableObject
(
g_fout
,
dobjs
[
i
]);
}
if
(
g_fout
->
verbose
)
dumpTimestamp
(
g_fout
,
"Completed on"
);
/*
* And finally we can do the actual output.
*/
...
...
@@ -1283,6 +1291,35 @@ 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
,
""
,
false
,
"DUMP TIMESTAMP"
,
qry
->
data
,
""
,
NULL
,
NULL
,
0
,
NULL
,
NULL
);
destroyPQExpBuffer
(
qry
);
}
}
/*
* dumpEncoding: put the correct encoding into the archive
*/
...
...
src/bin/pg_dump/pg_dumpall.c
View file @
91366138
...
...
@@ -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.3
7 2004/06/05 04:27:48
momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.3
8 2004/06/07 20:35:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -50,6 +50,7 @@ static void dumpDatabaseConfig(PGconn *conn, const char *dbname);
static
void
dumpUserConfig
(
PGconn
*
conn
,
const
char
*
username
);
static
void
makeAlterConfigCommand
(
const
char
*
arrayitem
,
const
char
*
type
,
const
char
*
name
);
static
void
dumpDatabases
(
PGconn
*
conn
);
static
void
dumpTimestamp
(
char
*
msg
);
static
int
runPgDump
(
const
char
*
dbname
);
static
PGconn
*
connectDatabase
(
const
char
*
dbname
,
const
char
*
pghost
,
const
char
*
pgport
,
...
...
@@ -220,6 +221,9 @@ main(int argc, char *argv[])
conn
=
connectDatabase
(
"template1"
,
pghost
,
pgport
,
pguser
,
force_password
);
printf
(
"--
\n
-- PostgreSQL database cluster dump
\n
--
\n\n
"
);
if
(
verbose
)
dumpTimestamp
(
"Started on"
);
printf
(
"
\\
connect
\"
template1
\"\n\n
"
);
if
(
!
data_only
)
...
...
@@ -237,6 +241,8 @@ main(int argc, char *argv[])
PQfinish
(
conn
);
if
(
verbose
)
dumpTimestamp
(
"Completed on"
);
printf
(
"--
\n
-- PostgreSQL database cluster dump complete
\n
--
\n\n
"
);
exit
(
0
);
...
...
@@ -808,3 +814,17 @@ executeQuery(PGconn *conn, const char *query)
return
res
;
}
/*
* dumpTimestamp
*/
static
void
dumpTimestamp
(
char
*
msg
)
{
char
buf
[
256
];
time_t
now
=
time
(
NULL
);
if
(
strftime
(
buf
,
256
,
"%Y-%m-%d %H:%M:%S %Z"
,
localtime
(
&
now
))
!=
0
)
printf
(
"-- %s %s
\n\n
"
,
msg
,
buf
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment