aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/dumputils.h')
-rw-r--r--src/bin/pg_dump/dumputils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h
index 688e9ca6b82..aaf40748524 100644
--- a/src/bin/pg_dump/dumputils.h
+++ b/src/bin/pg_dump/dumputils.h
@@ -49,6 +49,23 @@ typedef struct SimpleStringList
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
+/*
+ * Preferred strftime(3) format specifier for printing timestamps in pg_dump
+ * and friends.
+ *
+ * We don't print the timezone on Windows, 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. Think not to get around that by using %z, because
+ * (1) %z is not portable to pre-C99 systems, and
+ * (2) %z doesn't actually act differently from %Z on Windows anyway.
+ */
+#ifndef WIN32
+#define PGDUMP_STRFTIME_FMT "%Y-%m-%d %H:%M:%S %Z"
+#else
+#define PGDUMP_STRFTIME_FMT "%Y-%m-%d %H:%M:%S"
+#endif
+
extern int quote_all_identifiers;
extern PQExpBuffer (*getLocalPQExpBuffer) (void);