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

Commita0ed19e

Browse files
committed
Use PRI?64 instead of "ll?" in format strings (continued).
Continuation of work started in commit15a79c7, after initial trial.Author: Thomas Munro <thomas.munro@gmail.com>Discussion:https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org
1 parenta0a4601 commita0ed19e

File tree

54 files changed

+302
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+302
-311
lines changed

‎contrib/file_fdw/file_fdw.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,8 @@ fileIterateForeignScan(ForeignScanState *node)
798798
cstate->num_errors>cstate->opts.reject_limit)
799799
ereport(ERROR,
800800
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
801-
errmsg("skipped more than REJECT_LIMIT (%lld) rows due to data type incompatibility",
802-
(long long)cstate->opts.reject_limit)));
801+
errmsg("skipped more than REJECT_LIMIT (%"PRId64") rows due to data type incompatibility",
802+
cstate->opts.reject_limit)));
803803

804804
/* Repeat NextCopyFrom() until no soft error occurs */
805805
gotoretry;
@@ -855,10 +855,10 @@ fileEndForeignScan(ForeignScanState *node)
855855
festate->cstate->num_errors>0&&
856856
festate->cstate->opts.log_verbosity >=COPY_LOG_VERBOSITY_DEFAULT)
857857
ereport(NOTICE,
858-
errmsg_plural("%llu row was skipped due to data type incompatibility",
859-
"%llu rows were skipped due to data type incompatibility",
860-
(unsigned long long)festate->cstate->num_errors,
861-
(unsigned long long)festate->cstate->num_errors));
858+
errmsg_plural("%"PRIu64" row was skipped due to data type incompatibility",
859+
"%"PRIu64" rows were skipped due to data type incompatibility",
860+
festate->cstate->num_errors,
861+
festate->cstate->num_errors));
862862

863863
EndCopyFrom(festate->cstate);
864864
}
@@ -1319,10 +1319,10 @@ file_acquire_sample_rows(Relation onerel, int elevel,
13191319
cstate->num_errors>0&&
13201320
cstate->opts.log_verbosity >=COPY_LOG_VERBOSITY_DEFAULT)
13211321
ereport(NOTICE,
1322-
errmsg_plural("%llu row was skipped due to data type incompatibility",
1323-
"%llu rows were skipped due to data type incompatibility",
1324-
(unsigned long long)cstate->num_errors,
1325-
(unsigned long long)cstate->num_errors));
1322+
errmsg_plural("%"PRIu64" row was skipped due to data type incompatibility",
1323+
"%"PRIu64" rows were skipped due to data type incompatibility",
1324+
cstate->num_errors,
1325+
cstate->num_errors));
13261326

13271327
EndCopyFrom(cstate);
13281328

‎contrib/pageinspect/btreefuncs.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,12 @@ check_relation_block_range(Relation rel, int64 blkno)
206206
if (blkno<0||blkno>MaxBlockNumber)
207207
ereport(ERROR,
208208
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
209-
errmsg("invalid block number %lld",
210-
(long long)blkno)));
209+
errmsg("invalid block number %"PRId64,blkno)));
211210

212211
if ((BlockNumber) (blkno) >=RelationGetNumberOfBlocks(rel))
213212
ereport(ERROR,
214213
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
215-
errmsg("block number %lld is out of range",
216-
(long long)blkno)));
214+
errmsg("block number %"PRId64" is out of range",blkno)));
217215
}
218216

219217
/* -----------------------------------------------

‎contrib/pageinspect/hashfuncs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ hash_bitmap_info(PG_FUNCTION_ARGS)
436436
if (ovflblkno >=RelationGetNumberOfBlocks(indexRel))
437437
ereport(ERROR,
438438
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
439-
errmsg("block number %lld is out of range for relation \"%s\"",
440-
(long longint)ovflblkno,RelationGetRelationName(indexRel))));
439+
errmsg("block number %"PRId64" is out of range for relation \"%s\"",
440+
ovflblkno,RelationGetRelationName(indexRel))));
441441

442442
/* Read the metapage so we can determine which bitmap page to use */
443443
metabuf=_hash_getbuf(indexRel,HASH_METAPAGE,HASH_READ,LH_META_PAGE);

‎contrib/pg_prewarm/pg_prewarm.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ pg_prewarm(PG_FUNCTION_ARGS)
129129
if (first_block<0||first_block >=nblocks)
130130
ereport(ERROR,
131131
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
132-
errmsg("starting block number must be between 0 and %lld",
133-
(long long) (nblocks-1))));
132+
errmsg("starting block number must be between 0 and %"PRId64,
133+
(nblocks-1))));
134134
}
135135
if (PG_ARGISNULL(4))
136136
last_block=nblocks-1;
@@ -140,8 +140,8 @@ pg_prewarm(PG_FUNCTION_ARGS)
140140
if (last_block<0||last_block >=nblocks)
141141
ereport(ERROR,
142142
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
143-
errmsg("ending block number must be between 0 and %lld",
144-
(long long) (nblocks-1))));
143+
errmsg("ending block number must be between 0 and %"PRId64,
144+
(nblocks-1))));
145145
}
146146

147147
/* Now we're ready to do the real work. */

‎src/backend/access/brin/brin.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,7 @@ brin_summarize_range(PG_FUNCTION_ARGS)
14001400
if (heapBlk64>BRIN_ALL_BLOCKRANGES||heapBlk64<0)
14011401
ereport(ERROR,
14021402
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1403-
errmsg("block number out of range: %lld",
1404-
(long long)heapBlk64)));
1403+
errmsg("block number out of range: %"PRId64,heapBlk64)));
14051404
heapBlk= (BlockNumber)heapBlk64;
14061405

14071406
/*
@@ -1508,8 +1507,8 @@ brin_desummarize_range(PG_FUNCTION_ARGS)
15081507
if (heapBlk64>MaxBlockNumber||heapBlk64<0)
15091508
ereport(ERROR,
15101509
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1511-
errmsg("block number out of range: %lld",
1512-
(long long)heapBlk64)));
1510+
errmsg("block number out of range: %"PRId64,
1511+
heapBlk64)));
15131512
heapBlk= (BlockNumber)heapBlk64;
15141513

15151514
/*

‎src/backend/access/heap/vacuumlazy.c‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,14 +1020,14 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
10201020
orig_rel_pages,
10211021
vacrel->eager_scanned_pages);
10221022
appendStringInfo(&buf,
1023-
_("tuples: %lldremoved, %lldremain, %lld are dead but not yet removable\n"),
1024-
(long long)vacrel->tuples_deleted,
1025-
(long long)vacrel->new_rel_tuples,
1026-
(long long)vacrel->recently_dead_tuples);
1023+
_("tuples: %"PRId64"removed, %"PRId64"remain, %"PRId64" are dead but not yet removable\n"),
1024+
vacrel->tuples_deleted,
1025+
(int64)vacrel->new_rel_tuples,
1026+
vacrel->recently_dead_tuples);
10271027
if (vacrel->missed_dead_tuples>0)
10281028
appendStringInfo(&buf,
1029-
_("tuples missed: %lld dead from %u pages not removed due to cleanup lock contention\n"),
1030-
(long long)vacrel->missed_dead_tuples,
1029+
_("tuples missed: %"PRId64" dead from %u pages not removed due to cleanup lock contention\n"),
1030+
vacrel->missed_dead_tuples,
10311031
vacrel->missed_dead_pages);
10321032
diff= (int32) (ReadNextTransactionId()-
10331033
vacrel->cutoffs.OldestXmin);
@@ -1050,12 +1050,12 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
10501050
_("new relminmxid: %u, which is %d MXIDs ahead of previous value\n"),
10511051
vacrel->NewRelminMxid,diff);
10521052
}
1053-
appendStringInfo(&buf,_("frozen: %u pages from table (%.2f%% of total) had %lld tuples frozen\n"),
1053+
appendStringInfo(&buf,_("frozen: %u pages from table (%.2f%% of total) had %"PRId64" tuples frozen\n"),
10541054
vacrel->new_frozen_tuple_pages,
10551055
orig_rel_pages==0 ?100.0 :
10561056
100.0*vacrel->new_frozen_tuple_pages /
10571057
orig_rel_pages,
1058-
(long long)vacrel->tuples_frozen);
1058+
vacrel->tuples_frozen);
10591059

10601060
appendStringInfo(&buf,
10611061
_("visibility map: %u pages set all-visible, %u pages set all-frozen (%u were all-visible)\n"),
@@ -1070,7 +1070,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
10701070
else
10711071
appendStringInfoString(&buf,_("index scan needed: "));
10721072

1073-
msgfmt=_("%u pages from table (%.2f%% of total) had %lld dead item identifiers removed\n");
1073+
msgfmt=_("%u pages from table (%.2f%% of total) had %"PRId64" dead item identifiers removed\n");
10741074
}
10751075
else
10761076
{
@@ -1079,13 +1079,13 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
10791079
else
10801080
appendStringInfoString(&buf,_("index scan bypassed by failsafe: "));
10811081

1082-
msgfmt=_("%u pages from table (%.2f%% of total) have %lld dead item identifiers\n");
1082+
msgfmt=_("%u pages from table (%.2f%% of total) have %"PRId64" dead item identifiers\n");
10831083
}
10841084
appendStringInfo(&buf,msgfmt,
10851085
vacrel->lpdead_item_pages,
10861086
orig_rel_pages==0 ?100.0 :
10871087
100.0*vacrel->lpdead_item_pages /orig_rel_pages,
1088-
(long long)vacrel->lpdead_items);
1088+
vacrel->lpdead_items);
10891089
for (inti=0;i<vacrel->nindexes;i++)
10901090
{
10911091
IndexBulkDeleteResult*istat=vacrel->indstats[i];
@@ -1130,16 +1130,16 @@ heap_vacuum_rel(Relation rel, VacuumParams *params,
11301130
appendStringInfo(&buf,_("avg read rate: %.3f MB/s, avg write rate: %.3f MB/s\n"),
11311131
read_rate,write_rate);
11321132
appendStringInfo(&buf,
1133-
_("buffer usage: %lldhits, %lldreads, %lld dirtied\n"),
1134-
(long long)total_blks_hit,
1135-
(long long)total_blks_read,
1136-
(long long)total_blks_dirtied);
1133+
_("buffer usage: %"PRId64"hits, %"PRId64"reads, %"PRId64" dirtied\n"),
1134+
total_blks_hit,
1135+
total_blks_read,
1136+
total_blks_dirtied);
11371137
appendStringInfo(&buf,
1138-
_("WAL usage: %lldrecords, %lldfull page images, %llubytes, %lld buffers full\n"),
1139-
(long long)walusage.wal_records,
1140-
(long long)walusage.wal_fpi,
1141-
(unsigned long long)walusage.wal_bytes,
1142-
(long long)walusage.wal_buffers_full);
1138+
_("WAL usage: %"PRId64"records, %"PRId64"full page images, %"PRIu64"bytes, %"PRId64" buffers full\n"),
1139+
walusage.wal_records,
1140+
walusage.wal_fpi,
1141+
walusage.wal_bytes,
1142+
walusage.wal_buffers_full);
11431143
appendStringInfo(&buf,_("system usage: %s"),pg_rusage_show(&ru0));
11441144

11451145
ereport(verbose ?INFO :LOG,
@@ -2802,8 +2802,8 @@ lazy_vacuum_heap_rel(LVRelState *vacrel)
28022802
vacuumed_pages==vacrel->lpdead_item_pages));
28032803

28042804
ereport(DEBUG2,
2805-
(errmsg("table \"%s\": removed %lld dead item identifiers in %u pages",
2806-
vacrel->relname,(long long)vacrel->dead_items_info->num_items,
2805+
(errmsg("table \"%s\": removed %"PRId64" dead item identifiers in %u pages",
2806+
vacrel->relname,vacrel->dead_items_info->num_items,
28072807
vacuumed_pages)));
28082808

28092809
/* Revert to the previous phase information for error traceback */

‎src/backend/access/rmgrdesc/clogdesc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ clog_desc(StringInfo buf, XLogReaderState *record)
2828
int64pageno;
2929

3030
memcpy(&pageno,rec,sizeof(pageno));
31-
appendStringInfo(buf,"page %lld", (long long)pageno);
31+
appendStringInfo(buf,"page %"PRId64,pageno);
3232
}
3333
elseif (info==CLOG_TRUNCATE)
3434
{
3535
xl_clog_truncatexlrec;
3636

3737
memcpy(&xlrec,rec,sizeof(xl_clog_truncate));
38-
appendStringInfo(buf,"page %lld; oldestXact %u",
39-
(long long)xlrec.pageno,xlrec.oldestXact);
38+
appendStringInfo(buf,"page %"PRId64"; oldestXact %u",
39+
xlrec.pageno,xlrec.oldestXact);
4040
}
4141
}
4242

‎src/backend/access/rmgrdesc/committsdesc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ commit_ts_desc(StringInfo buf, XLogReaderState *record)
2828
int64pageno;
2929

3030
memcpy(&pageno,rec,sizeof(pageno));
31-
appendStringInfo(buf,"%lld", (long long)pageno);
31+
appendStringInfo(buf,"%"PRId64,pageno);
3232
}
3333
elseif (info==COMMIT_TS_TRUNCATE)
3434
{
3535
xl_commit_ts_truncate*trunc= (xl_commit_ts_truncate*)rec;
3636

37-
appendStringInfo(buf,"pageno %lld, oldestXid %u",
38-
(long long)trunc->pageno,trunc->oldestXid);
37+
appendStringInfo(buf,"pageno %"PRId64", oldestXid %u",
38+
trunc->pageno,trunc->oldestXid);
3939
}
4040
}
4141

‎src/backend/access/rmgrdesc/mxactdesc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ multixact_desc(StringInfo buf, XLogReaderState *record)
5858
int64pageno;
5959

6060
memcpy(&pageno,rec,sizeof(pageno));
61-
appendStringInfo(buf,"%lld", (long long)pageno);
61+
appendStringInfo(buf,"%"PRId64,pageno);
6262
}
6363
elseif (info==XLOG_MULTIXACT_CREATE_ID)
6464
{

‎src/backend/access/rmgrdesc/xactdesc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ xact_desc_stats(StringInfo buf, const char *label,
320320
uint64objid=
321321
((uint64)dropped_stats[i].objid_hi) <<32 |dropped_stats[i].objid_lo;
322322

323-
appendStringInfo(buf," %d/%u/%llu",
323+
appendStringInfo(buf," %d/%u/%"PRIu64,
324324
dropped_stats[i].kind,
325325
dropped_stats[i].dboid,
326-
(unsigned long long)objid);
326+
objid);
327327
}
328328
}
329329
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp