aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-03-29 10:30:08 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-03-29 10:43:57 +0100
commita0ed19e0a9efe93b3b83d6e3fe8f77656be253a2 (patch)
tree8c1040a46a47098d3fe5199530576a1a68acc20f /src/backend/commands/sequence.c
parenta0a4601765b896079eb82a9d5cfa1f41154fcfdb (diff)
downloadpostgresql-a0ed19e0a9efe93b3b83d6e3fe8f77656be253a2.tar.gz
postgresql-a0ed19e0a9efe93b3b83d6e3fe8f77656be253a2.zip
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
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r--src/backend/commands/sequence.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 4b7c5113aab..451ae6f7f69 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -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)