Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit740d718

Browse files
committed
Further fixing to make pg_size_bytes() portable.
Not all compilers support "long long" and the "LL" integer literalsuffix, so use a cast to int64 instead.
1 parentad7cc1c commit740d718

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/backend/utils/adt/dbsize.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -813,15 +813,15 @@ pg_size_bytes(PG_FUNCTION_ARGS)
813813

814814
/* Parse the unit case-insensitively */
815815
if (pg_strcasecmp(strptr,"bytes")==0)
816-
multiplier=1;
816+
multiplier=(int64)1;
817817
elseif (pg_strcasecmp(strptr,"kb")==0)
818-
multiplier=1024;
818+
multiplier=(int64)1024;
819819
elseif (pg_strcasecmp(strptr,"mb")==0)
820-
multiplier=1024*1024;
820+
multiplier=(int64)1024*1024;
821821
elseif (pg_strcasecmp(strptr,"gb")==0)
822-
multiplier=1024*1024*1024;
822+
multiplier=(int64)1024*1024*1024;
823823
elseif (pg_strcasecmp(strptr,"tb")==0)
824-
multiplier=1024*1024*1024*1024LL;
824+
multiplier=(int64)1024*1024*1024*1024;
825825
else
826826
ereport(ERROR,
827827
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp