diff options
author | Bruce Momjian <bruce@momjian.us> | 2014-09-05 19:22:31 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2014-09-05 19:22:31 -0400 |
commit | ad5d46a4494b0b480a3af246bb4227d9bdadca37 (patch) | |
tree | b658abbd9df56ea977476ddce7ba7ce4f33e5321 /src/bin/pg_dump/pg_dumpall.c | |
parent | a74a4aa23bb95b590ff01ee564219d2eacea3706 (diff) | |
download | postgresql-ad5d46a4494b0b480a3af246bb4227d9bdadca37.tar.gz postgresql-ad5d46a4494b0b480a3af246bb4227d9bdadca37.zip |
Report timezone offset in pg_dump/pg_dumpall
Use consistent format for all such displays.
Report by Gavin Flower
Diffstat (limited to 'src/bin/pg_dump/pg_dumpall.c')
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index 405009158d5..b2b3e6feb74 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -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); } |