summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Rasheed2016-02-20 15:49:26 +0000
committerDean Rasheed2016-02-20 15:49:26 +0000
commit740d71842b8e0e798c80f4f841227b6de81b5f43 (patch)
tree9c481c73d8450668c7b0c9e06d321554d9aed770
parentad7cc1c554980145b226a066afe56d9c777ce7ae (diff)
Further fixing to make pg_size_bytes() portable.
Not all compilers support "long long" and the "LL" integer literal suffix, so use a cast to int64 instead.
-rw-r--r--src/backend/utils/adt/dbsize.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index ba84c48cfd..1db4acf175 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -813,15 +813,15 @@ pg_size_bytes(PG_FUNCTION_ARGS)
/* Parse the unit case-insensitively */
if (pg_strcasecmp(strptr, "bytes") == 0)
- multiplier = 1;
+ multiplier = (int64) 1;
else if (pg_strcasecmp(strptr, "kb") == 0)
- multiplier = 1024;
+ multiplier = (int64) 1024;
else if (pg_strcasecmp(strptr, "mb") == 0)
- multiplier = 1024 * 1024;
+ multiplier = (int64) 1024 * 1024;
else if (pg_strcasecmp(strptr, "gb") == 0)
- multiplier = 1024 * 1024 * 1024;
+ multiplier = (int64) 1024 * 1024 * 1024;
else if (pg_strcasecmp(strptr, "tb") == 0)
- multiplier = 1024 * 1024 * 1024 * 1024LL;
+ multiplier = (int64) 1024 * 1024 * 1024 * 1024;
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),