1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-31 10:30:33 +03:00

Use PRI?64 instead of "ll?" in format strings (continued).

Continuation of work started in commit 15a79c73, after initial trial.

Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-03-29 10:30:08 +01:00
parent a0a4601765
commit a0ed19e0a9
54 changed files with 302 additions and 311 deletions

View File

@@ -745,9 +745,9 @@ nextval_internal(Oid relid, bool check_permissions)
if (!cycle)
ereport(ERROR,
(errcode(ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED),
errmsg("nextval: reached maximum value of sequence \"%s\" (%lld)",
errmsg("nextval: reached maximum value of sequence \"%s\" (%" PRId64 ")",
RelationGetRelationName(seqrel),
(long long) maxv)));
maxv)));
next = minv;
}
else
@@ -764,9 +764,9 @@ nextval_internal(Oid relid, bool check_permissions)
if (!cycle)
ereport(ERROR,
(errcode(ERRCODE_SEQUENCE_GENERATOR_LIMIT_EXCEEDED),
errmsg("nextval: reached minimum value of sequence \"%s\" (%lld)",
errmsg("nextval: reached minimum value of sequence \"%s\" (%" PRId64 ")",
RelationGetRelationName(seqrel),
(long long) minv)));
minv)));
next = maxv;
}
else
@@ -988,9 +988,9 @@ do_setval(Oid relid, int64 next, bool iscalled)
if ((next < minv) || (next > maxv))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
errmsg("setval: value %lld is out of bounds for sequence \"%s\" (%lld..%lld)",
(long long) next, RelationGetRelationName(seqrel),
(long long) minv, (long long) maxv)));
errmsg("setval: value %" PRId64 " is out of bounds for sequence \"%s\" (%" PRId64 "..%" PRId64 ")",
next, RelationGetRelationName(seqrel),
minv, maxv)));
/* Set the currval() state only if iscalled = true */
if (iscalled)
@@ -1463,8 +1463,8 @@ init_params(ParseState *pstate, List *options, bool for_identity,
|| (seqform->seqtypid == INT4OID && (seqform->seqmax < PG_INT32_MIN || seqform->seqmax > PG_INT32_MAX)))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("MAXVALUE (%lld) is out of range for sequence data type %s",
(long long) seqform->seqmax,
errmsg("MAXVALUE (%" PRId64 ") is out of range for sequence data type %s",
seqform->seqmax,
format_type_be(seqform->seqtypid))));
/* MINVALUE (null arg means NO MINVALUE) */
@@ -1495,17 +1495,17 @@ init_params(ParseState *pstate, List *options, bool for_identity,
|| (seqform->seqtypid == INT4OID && (seqform->seqmin < PG_INT32_MIN || seqform->seqmin > PG_INT32_MAX)))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("MINVALUE (%lld) is out of range for sequence data type %s",
(long long) seqform->seqmin,
errmsg("MINVALUE (%" PRId64 ") is out of range for sequence data type %s",
seqform->seqmin,
format_type_be(seqform->seqtypid))));
/* crosscheck min/max */
if (seqform->seqmin >= seqform->seqmax)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("MINVALUE (%lld) must be less than MAXVALUE (%lld)",
(long long) seqform->seqmin,
(long long) seqform->seqmax)));
errmsg("MINVALUE (%" PRId64 ") must be less than MAXVALUE (%" PRId64 ")",
seqform->seqmin,
seqform->seqmax)));
/* START WITH */
if (start_value != NULL)
@@ -1524,15 +1524,15 @@ init_params(ParseState *pstate, List *options, bool for_identity,
if (seqform->seqstart < seqform->seqmin)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("START value (%lld) cannot be less than MINVALUE (%lld)",
(long long) seqform->seqstart,
(long long) seqform->seqmin)));
errmsg("START value (%" PRId64 ") cannot be less than MINVALUE (%" PRId64 ")",
seqform->seqstart,
seqform->seqmin)));
if (seqform->seqstart > seqform->seqmax)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("START value (%lld) cannot be greater than MAXVALUE (%lld)",
(long long) seqform->seqstart,
(long long) seqform->seqmax)));
errmsg("START value (%" PRId64 ") cannot be greater than MAXVALUE (%" PRId64 ")",
seqform->seqstart,
seqform->seqmax)));
/* RESTART [WITH] */
if (restart_value != NULL)
@@ -1554,15 +1554,15 @@ init_params(ParseState *pstate, List *options, bool for_identity,
if (seqdataform->last_value < seqform->seqmin)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("RESTART value (%lld) cannot be less than MINVALUE (%lld)",
(long long) seqdataform->last_value,
(long long) seqform->seqmin)));
errmsg("RESTART value (%" PRId64 ") cannot be less than MINVALUE (%" PRId64 ")",
seqdataform->last_value,
seqform->seqmin)));
if (seqdataform->last_value > seqform->seqmax)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("RESTART value (%lld) cannot be greater than MAXVALUE (%lld)",
(long long) seqdataform->last_value,
(long long) seqform->seqmax)));
errmsg("RESTART value (%" PRId64 ") cannot be greater than MAXVALUE (%" PRId64 ")",
seqdataform->last_value,
seqform->seqmax)));
/* CACHE */
if (cache_value != NULL)
@@ -1571,8 +1571,8 @@ init_params(ParseState *pstate, List *options, bool for_identity,
if (seqform->seqcache <= 0)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("CACHE (%lld) must be greater than zero",
(long long) seqform->seqcache)));
errmsg("CACHE (%" PRId64 ") must be greater than zero",
seqform->seqcache)));
seqdataform->log_cnt = 0;
}
else if (isInit)