aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/dumputils.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2002-09-07 16:14:33 +0000
committerPeter Eisentraut <peter_e@gmx.net>2002-09-07 16:14:33 +0000
commit40853dd445442e23eec4ffeefa418e53e29e0c23 (patch)
tree000bc1ba8e7beb28ee7e7ebecdfc21cdec8647c4 /src/bin/pg_dump/dumputils.c
parent123baf83104c3b9db4918881fa9cd9b1e0342dc4 (diff)
downloadpostgresql-40853dd445442e23eec4ffeefa418e53e29e0c23.tar.gz
postgresql-40853dd445442e23eec4ffeefa418e53e29e0c23.zip
Allow pg_dumpall to work with previous releases again. Don't pass the -c
option down to pg_dump, where it's useless, and clarify the meaning of -c in the documentation.
Diffstat (limited to 'src/bin/pg_dump/dumputils.c')
-rw-r--r--src/bin/pg_dump/dumputils.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c
index ef71182fcca..259a8c56395 100644
--- a/src/bin/pg_dump/dumputils.c
+++ b/src/bin/pg_dump/dumputils.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/dumputils.c,v 1.2 2002/09/04 20:31:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/dumputils.c,v 1.3 2002/09/07 16:14:33 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -131,3 +131,24 @@ appendStringLiteral(PQExpBuffer buf, const char *str, bool escapeAll)
}
appendPQExpBufferChar(buf, '\'');
}
+
+
+
+int
+parse_version(const char *versionString)
+{
+ int cnt;
+ int vmaj,
+ vmin,
+ vrev;
+
+ cnt = sscanf(versionString, "%d.%d.%d", &vmaj, &vmin, &vrev);
+
+ if (cnt < 2)
+ return -1;
+
+ if (cnt == 2)
+ vrev = 0;
+
+ return (100 * vmaj + vmin) * 100 + vrev;
+}