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
ad5d46a4
Commit
ad5d46a4
authored
Sep 05, 2014
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report timezone offset in pg_dump/pg_dumpall
Use consistent format for all such displays. Report by Gavin Flower
parent
a74a4aa2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
29 deletions
+8
-29
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+6
-15
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+2
-14
No files found.
src/bin/pg_dump/pg_backup_archiver.c
View file @
ad5d46a4
...
...
@@ -964,12 +964,15 @@ PrintTOCSummary(Archive *AHX, RestoreOptions *ropt)
teSection
curSection
;
OutputContext
sav
;
const
char
*
fmtName
;
struct
tm
*
tm
=
localtime
(
&
AH
->
createDate
);
char
stamp_str
[
64
];
sav
=
SaveOutput
(
AH
);
if
(
ropt
->
filename
)
SetOutput
(
AH
,
ropt
->
filename
,
0
/* no compression */
);
ahprintf
(
AH
,
";
\n
; Archive created at %s"
,
ctime
(
&
AH
->
createDate
));
strftime
(
stamp_str
,
sizeof
(
stamp_str
),
"%Y-%m-%d %H:%M:%S %z"
,
tm
);
ahprintf
(
AH
,
";
\n
; Archive created at %s
\n
"
,
stamp_str
);
ahprintf
(
AH
,
"; dbname: %s
\n
; TOC Entries: %d
\n
; Compression: %d
\n
"
,
AH
->
archdbname
,
AH
->
tocCount
,
AH
->
compression
);
...
...
@@ -3455,21 +3458,9 @@ checkSeek(FILE *fp)
static
void
dumpTimestamp
(
ArchiveHandle
*
AH
,
const
char
*
msg
,
time_t
tim
)
{
char
buf
[
256
];
char
buf
[
64
];
/*
* We don't print the timezone on Win32, because the names are long and
* localized, which means they may contain characters in various random
* encodings; this has been seen to cause encoding errors when reading the
* dump script.
*/
if
(
strftime
(
buf
,
sizeof
(
buf
),
#ifndef WIN32
"%Y-%m-%d %H:%M:%S %Z"
,
#else
"%Y-%m-%d %H:%M:%S"
,
#endif
localtime
(
&
tim
))
!=
0
)
if
(
strftime
(
buf
,
sizeof
(
buf
),
"%Y-%m-%d %H:%M:%S %z"
,
localtime
(
&
tim
))
!=
0
)
ahprintf
(
AH
,
"-- %s %s
\n\n
"
,
msg
,
buf
);
}
...
...
src/bin/pg_dump/pg_dumpall.c
View file @
ad5d46a4
...
...
@@ -2039,22 +2039,10 @@ executeCommand(PGconn *conn, const char *query)
static
void
dumpTimestamp
(
char
*
msg
)
{
char
buf
[
256
];
char
buf
[
64
];
time_t
now
=
time
(
NULL
);
/*
* We don't print the timezone on Win32, because the names are long and
* localized, which means they may contain characters in various random
* encodings; this has been seen to cause encoding errors when reading the
* dump script.
*/
if
(
strftime
(
buf
,
sizeof
(
buf
),
#ifndef WIN32
"%Y-%m-%d %H:%M:%S %Z"
,
#else
"%Y-%m-%d %H:%M:%S"
,
#endif
localtime
(
&
now
))
!=
0
)
if
(
strftime
(
buf
,
sizeof
(
buf
),
"%Y-%m-%d %H:%M:%S %z"
,
localtime
(
&
now
))
!=
0
)
fprintf
(
OPF
,
"-- %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