diff options
author | Peter Eisentraut | 2025-03-29 09:30:08 +0000 |
---|---|---|
committer | Peter Eisentraut | 2025-03-29 09:43:57 +0000 |
commit | a0ed19e0a9efe93b3b83d6e3fe8f77656be253a2 (patch) | |
tree | 8c1040a46a47098d3fe5199530576a1a68acc20f /src/backend/commands | |
parent | a0a4601765b896079eb82a9d5cfa1f41154fcfdb (diff) |
Use PRI?64 instead of "ll?" in format strings (continued).
Continuation of work started in commit 15a79c73, after initial trial.
Author: Thomas Munro <[email protected]>
Discussion: https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/analyze.c | 18 | ||||
-rw-r--r-- | src/backend/commands/copy.c | 4 | ||||
-rw-r--r-- | src/backend/commands/copyfrom.c | 36 | ||||
-rw-r--r-- | src/backend/commands/copyfromparse.c | 8 | ||||
-rw-r--r-- | src/backend/commands/explain.c | 54 | ||||
-rw-r--r-- | src/backend/commands/sequence.c | 56 | ||||
-rw-r--r-- | src/backend/commands/vacuum.c | 4 |
7 files changed, 90 insertions, 90 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 2b5fbdcbd82..ca76c0d2668 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -827,16 +827,16 @@ do_analyze_rel(Relation onerel, VacuumParams *params, } appendStringInfo(&buf, _("avg read rate: %.3f MB/s, avg write rate: %.3f MB/s\n"), read_rate, write_rate); - appendStringInfo(&buf, _("buffer usage: %lld hits, %lld reads, %lld dirtied\n"), - (long long) total_blks_hit, - (long long) total_blks_read, - (long long) total_blks_dirtied); + appendStringInfo(&buf, _("buffer usage: %" PRId64 " hits, %" PRId64 " reads, %" PRId64 " dirtied\n"), + total_blks_hit, + total_blks_read, + total_blks_dirtied); appendStringInfo(&buf, - _("WAL usage: %lld records, %lld full page images, %llu bytes, %lld buffers full\n"), - (long long) walusage.wal_records, - (long long) walusage.wal_fpi, - (unsigned long long) walusage.wal_bytes, - (long long) walusage.wal_buffers_full); + _("WAL usage: %" PRId64 " records, %" PRId64 " full page images, %" PRIu64 " bytes, %" PRId64 " buffers full\n"), + walusage.wal_records, + walusage.wal_fpi, + walusage.wal_bytes, + walusage.wal_buffers_full); appendStringInfo(&buf, _("system usage: %s"), pg_rusage_show(&ru0)); ereport(verbose ? INFO : LOG, diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index cfca9d9dc29..74ae42b19a7 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -443,8 +443,8 @@ defGetCopyRejectLimitOption(DefElem *def) if (reject_limit <= 0) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("REJECT_LIMIT (%lld) must be greater than zero", - (long long) reject_limit))); + errmsg("REJECT_LIMIT (%" PRId64 ") must be greater than zero", + reject_limit))); return reject_limit; } diff --git a/src/backend/commands/copyfrom.c b/src/backend/commands/copyfrom.c index bcf66f0adf8..fbbbc09a97b 100644 --- a/src/backend/commands/copyfrom.c +++ b/src/backend/commands/copyfrom.c @@ -265,14 +265,14 @@ CopyFromErrorCallback(void *arg) { /* can't usefully display the data */ if (cstate->cur_attname) - errcontext("COPY %s, line %llu, column %s", + errcontext("COPY %s, line %" PRIu64 ", column %s", cstate->cur_relname, - (unsigned long long) cstate->cur_lineno, + cstate->cur_lineno, cstate->cur_attname); else - errcontext("COPY %s, line %llu", + errcontext("COPY %s, line %" PRIu64, cstate->cur_relname, - (unsigned long long) cstate->cur_lineno); + cstate->cur_lineno); } else { @@ -282,9 +282,9 @@ CopyFromErrorCallback(void *arg) char *attval; attval = CopyLimitPrintoutLength(cstate->cur_attval); - errcontext("COPY %s, line %llu, column %s: \"%s\"", + errcontext("COPY %s, line %" PRIu64 ", column %s: \"%s\"", cstate->cur_relname, - (unsigned long long) cstate->cur_lineno, + cstate->cur_lineno, cstate->cur_attname, attval); pfree(attval); @@ -292,9 +292,9 @@ CopyFromErrorCallback(void *arg) else if (cstate->cur_attname) { /* error is relevant to a particular column, value is NULL */ - errcontext("COPY %s, line %llu, column %s: null input", + errcontext("COPY %s, line %" PRIu64 ", column %s: null input", cstate->cur_relname, - (unsigned long long) cstate->cur_lineno, + cstate->cur_lineno, cstate->cur_attname); } else @@ -309,16 +309,16 @@ CopyFromErrorCallback(void *arg) char *lineval; lineval = CopyLimitPrintoutLength(cstate->line_buf.data); - errcontext("COPY %s, line %llu: \"%s\"", + errcontext("COPY %s, line %" PRIu64 ": \"%s\"", cstate->cur_relname, - (unsigned long long) cstate->cur_lineno, lineval); + cstate->cur_lineno, lineval); pfree(lineval); } else { - errcontext("COPY %s, line %llu", + errcontext("COPY %s, line %" PRIu64, cstate->cur_relname, - (unsigned long long) cstate->cur_lineno); + cstate->cur_lineno); } } } @@ -1168,8 +1168,8 @@ CopyFrom(CopyFromState cstate) cstate->num_errors > cstate->opts.reject_limit) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), - errmsg("skipped more than REJECT_LIMIT (%lld) rows due to data type incompatibility", - (long long) cstate->opts.reject_limit))); + errmsg("skipped more than REJECT_LIMIT (%" PRId64 ") rows due to data type incompatibility", + cstate->opts.reject_limit))); /* Repeat NextCopyFrom() until no soft error occurs */ continue; @@ -1471,10 +1471,10 @@ CopyFrom(CopyFromState cstate) cstate->num_errors > 0 && cstate->opts.log_verbosity >= COPY_LOG_VERBOSITY_DEFAULT) ereport(NOTICE, - errmsg_plural("%llu row was skipped due to data type incompatibility", - "%llu rows were skipped due to data type incompatibility", - (unsigned long long) cstate->num_errors, - (unsigned long long) cstate->num_errors)); + errmsg_plural("%" PRIu64 " row was skipped due to data type incompatibility", + "%" PRIu64 " rows were skipped due to data type incompatibility", + cstate->num_errors, + cstate->num_errors)); if (bistate != NULL) FreeBulkInsertState(bistate); diff --git a/src/backend/commands/copyfromparse.c b/src/backend/commands/copyfromparse.c index e8128f85e6b..f5fc346e201 100644 --- a/src/backend/commands/copyfromparse.c +++ b/src/backend/commands/copyfromparse.c @@ -1053,16 +1053,16 @@ CopyFromTextLikeOneRow(CopyFromState cstate, ExprContext *econtext, attval = CopyLimitPrintoutLength(cstate->cur_attval); ereport(NOTICE, - errmsg("skipping row due to data type incompatibility at line %llu for column \"%s\": \"%s\"", - (unsigned long long) cstate->cur_lineno, + errmsg("skipping row due to data type incompatibility at line %" PRIu64 " for column \"%s\": \"%s\"", + cstate->cur_lineno, cstate->cur_attname, attval)); pfree(attval); } else ereport(NOTICE, - errmsg("skipping row due to data type incompatibility at line %llu for column \"%s\": null input", - (unsigned long long) cstate->cur_lineno, + errmsg("skipping row due to data type incompatibility at line %" PRIu64 " for column \"%s\": null input", + cstate->cur_lineno, cstate->cur_attname)); /* reset relname_only */ diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 391b34a2af2..ef8aa489af8 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -4126,17 +4126,17 @@ show_buffer_usage(ExplainState *es, const BufferUsage *usage) { appendStringInfoString(es->str, " shared"); if (usage->shared_blks_hit > 0) - appendStringInfo(es->str, " hit=%lld", - (long long) usage->shared_blks_hit); + appendStringInfo(es->str, " hit=%" PRId64, + usage->shared_blks_hit); if (usage->shared_blks_read > 0) - appendStringInfo(es->str, " read=%lld", - (long long) usage->shared_blks_read); + appendStringInfo(es->str, " read=%" PRId64, + usage->shared_blks_read); if (usage->shared_blks_dirtied > 0) - appendStringInfo(es->str, " dirtied=%lld", - (long long) usage->shared_blks_dirtied); + appendStringInfo(es->str, " dirtied=%" PRId64, + usage->shared_blks_dirtied); if (usage->shared_blks_written > 0) - appendStringInfo(es->str, " written=%lld", - (long long) usage->shared_blks_written); + appendStringInfo(es->str, " written=%" PRId64, + usage->shared_blks_written); if (has_local || has_temp) appendStringInfoChar(es->str, ','); } @@ -4144,17 +4144,17 @@ show_buffer_usage(ExplainState *es, const BufferUsage *usage) { appendStringInfoString(es->str, " local"); if (usage->local_blks_hit > 0) - appendStringInfo(es->str, " hit=%lld", - (long long) usage->local_blks_hit); + appendStringInfo(es->str, " hit=%" PRId64, + usage->local_blks_hit); if (usage->local_blks_read > 0) - appendStringInfo(es->str, " read=%lld", - (long long) usage->local_blks_read); + appendStringInfo(es->str, " read=%" PRId64, + usage->local_blks_read); if (usage->local_blks_dirtied > 0) - appendStringInfo(es->str, " dirtied=%lld", - (long long) usage->local_blks_dirtied); + appendStringInfo(es->str, " dirtied=%" PRId64, + usage->local_blks_dirtied); if (usage->local_blks_written > 0) - appendStringInfo(es->str, " written=%lld", - (long long) usage->local_blks_written); + appendStringInfo(es->str, " written=%" PRId64, + usage->local_blks_written); if (has_temp) appendStringInfoChar(es->str, ','); } @@ -4162,11 +4162,11 @@ show_buffer_usage(ExplainState *es, const BufferUsage *usage) { appendStringInfoString(es->str, " temp"); if (usage->temp_blks_read > 0) - appendStringInfo(es->str, " read=%lld", - (long long) usage->temp_blks_read); + appendStringInfo(es->str, " read=%" PRId64, + usage->temp_blks_read); if (usage->temp_blks_written > 0) - appendStringInfo(es->str, " written=%lld", - (long long) usage->temp_blks_written); + appendStringInfo(es->str, " written=%" PRId64, + usage->temp_blks_written); } appendStringInfoChar(es->str, '\n'); } @@ -4276,17 +4276,17 @@ show_wal_usage(ExplainState *es, const WalUsage *usage) appendStringInfoString(es->str, "WAL:"); if (usage->wal_records > 0) - appendStringInfo(es->str, " records=%lld", - (long long) usage->wal_records); + appendStringInfo(es->str, " records=%" PRId64, + usage->wal_records); if (usage->wal_fpi > 0) - appendStringInfo(es->str, " fpi=%lld", - (long long) usage->wal_fpi); + appendStringInfo(es->str, " fpi=%" PRId64, + usage->wal_fpi); if (usage->wal_bytes > 0) - appendStringInfo(es->str, " bytes=" UINT64_FORMAT, + appendStringInfo(es->str, " bytes=%" PRIu64, usage->wal_bytes); if (usage->wal_buffers_full > 0) - appendStringInfo(es->str, " buffers full=%lld", - (long long) usage->wal_buffers_full); + appendStringInfo(es->str, " buffers full=%" PRId64, + usage->wal_buffers_full); appendStringInfoChar(es->str, '\n'); } } 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) diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index f0a7b87808d..db5da3ce826 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -2614,9 +2614,9 @@ vac_bulkdel_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat, dead_items); ereport(ivinfo->message_level, - (errmsg("scanned index \"%s\" to remove %lld row versions", + (errmsg("scanned index \"%s\" to remove %" PRId64 " row versions", RelationGetRelationName(ivinfo->index), - (long long) dead_items_info->num_items))); + dead_items_info->num_items))); return istat; } |