aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-04-07 19:27:00 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-04-07 19:27:00 -0300
commit8acc1e0fe21015d403c0e005d92d04250ece84b9 (patch)
treec48e227b5871b8fc48259a57ccd18e3db114d082 /src
parent8bf74967dab1b368f4e217c960ede1516c42a989 (diff)
downloadpostgresql-8acc1e0fe21015d403c0e005d92d04250ece84b9.tar.gz
postgresql-8acc1e0fe21015d403c0e005d92d04250ece84b9.zip
Fix printf format to use %zd when printing sizes
Using %ld as we were doing raises compiler warnings on 32 bit platforms. Reported by Andres Freund. Discussion: https://postgr.es/m/20170407214022.fidezl2e6rk3tuiz@alap3.anarazel.de
Diffstat (limited to 'src')
-rw-r--r--src/backend/statistics/dependencies.c4
-rw-r--r--src/backend/statistics/mvdistinct.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/statistics/dependencies.c b/src/backend/statistics/dependencies.c
index 1a90e4b7157..fee07c6b34d 100644
--- a/src/backend/statistics/dependencies.c
+++ b/src/backend/statistics/dependencies.c
@@ -511,7 +511,7 @@ statext_dependencies_deserialize(bytea *data)
return NULL;
if (VARSIZE_ANY_EXHDR(data) < SizeOfDependencies)
- elog(ERROR, "invalid MVDependencies size %ld (expected at least %ld)",
+ elog(ERROR, "invalid MVDependencies size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), SizeOfDependencies);
/* read the MVDependencies header */
@@ -547,7 +547,7 @@ statext_dependencies_deserialize(bytea *data)
sizeof(AttrNumber) * 2);
if (VARSIZE_ANY_EXHDR(data) < min_expected_size)
- elog(ERROR, "invalid dependencies size %ld (expected at least %ld)",
+ elog(ERROR, "invalid dependencies size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), min_expected_size);
/* allocate space for the MCV items */
diff --git a/src/backend/statistics/mvdistinct.c b/src/backend/statistics/mvdistinct.c
index 6082ff01a9a..ece544b3a3c 100644
--- a/src/backend/statistics/mvdistinct.c
+++ b/src/backend/statistics/mvdistinct.c
@@ -238,7 +238,7 @@ statext_ndistinct_deserialize(bytea *data)
/* we expect at least the basic fields of MVNDistinct struct */
if (VARSIZE_ANY_EXHDR(data) < SizeOfMVNDistinct)
- elog(ERROR, "invalid MVNDistinct size %ld (expected at least %ld)",
+ elog(ERROR, "invalid MVNDistinct size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), SizeOfMVNDistinct);
/* initialize pointer to the data part (skip the varlena header) */
@@ -274,7 +274,7 @@ statext_ndistinct_deserialize(bytea *data)
if (VARSIZE_ANY_EXHDR(data) < minimum_size)
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
- errmsg("invalid MVNDistinct size %ld (expected at least %ld)",
+ errmsg("invalid MVNDistinct size %zd (expected at least %zd)",
VARSIZE_ANY_EXHDR(data), minimum_size)));
/*