提交 740d7184 编写于 作者: D Dean Rasheed

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.
上级 ad7cc1c5
......@@ -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),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册