aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/util.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2010-09-28 21:41:03 +0000
committerBruce Momjian <bruce@momjian.us>2010-09-28 21:41:03 +0000
commit9340fb80b1dba5528c0d16b24985369659a19377 (patch)
tree9f4fd6fd6b30a6f694a88156baefe445e385aad5 /contrib/pg_upgrade/util.c
parenta1bb570de97c71eba3c1b7a067063e8ba28c41d5 (diff)
downloadpostgresql-9340fb80b1dba5528c0d16b24985369659a19377.tar.gz
postgresql-9340fb80b1dba5528c0d16b24985369659a19377.zip
In pg_upgrade, properly handle oids > 2^31 by using strtoul() internally
rather than atol(). Per report from Brian Hirt
Diffstat (limited to 'contrib/pg_upgrade/util.c')
-rw-r--r--contrib/pg_upgrade/util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c
index b9968e9132c..3f3a4c700d0 100644
--- a/contrib/pg_upgrade/util.c
+++ b/contrib/pg_upgrade/util.c
@@ -259,3 +259,15 @@ getErrorText(int errNum)
#endif
return strdup(strerror(errNum));
}
+
+
+/*
+ * str2uint()
+ *
+ * convert string to oid
+ */
+unsigned int
+str2uint(const char *str)
+{
+ return strtol(str, NULL, 10);
+}