if (rdoffnum < FirstOffsetNumber)
{
report_corruption(&ctx,
- psprintf("line pointer redirection to item at offset %u precedes minimum offset %u",
- (unsigned) rdoffnum,
- (unsigned) FirstOffsetNumber));
+ psprintf("line pointer redirection to item at offset %d precedes minimum offset %d",
+ rdoffnum,
+ FirstOffsetNumber));
continue;
}
if (rdoffnum > maxoff)
{
report_corruption(&ctx,
- psprintf("line pointer redirection to item at offset %u exceeds maximum offset %u",
- (unsigned) rdoffnum,
- (unsigned) maxoff));
+ psprintf("line pointer redirection to item at offset %d exceeds maximum offset %d",
+ rdoffnum,
+ maxoff));
continue;
}
if (!ItemIdIsUsed(rditem))
{
report_corruption(&ctx,
- psprintf("redirected line pointer points to an unused item at offset %u",
- (unsigned) rdoffnum));
+ psprintf("redirected line pointer points to an unused item at offset %d",
+ rdoffnum));
continue;
}
else if (ItemIdIsDead(rditem))
{
report_corruption(&ctx,
- psprintf("redirected line pointer points to a dead item at offset %u",
- (unsigned) rdoffnum));
+ psprintf("redirected line pointer points to a dead item at offset %d",
+ rdoffnum));
continue;
}
else if (ItemIdIsRedirected(rditem))
{
report_corruption(&ctx,
- psprintf("redirected line pointer points to another redirected line pointer at offset %u",
- (unsigned) rdoffnum));
+ psprintf("redirected line pointer points to another redirected line pointer at offset %d",
+ rdoffnum));
continue;
}
if (ctx.lp_off + ctx.lp_len > BLCKSZ)
{
report_corruption(&ctx,
- psprintf("line pointer to page offset %u with length %u ends beyond maximum page offset %u",
+ psprintf("line pointer to page offset %u with length %u ends beyond maximum page offset %d",
ctx.lp_off,
ctx.lp_len,
- (unsigned) BLCKSZ));
+ BLCKSZ));
continue;
}
if (!HeapTupleHeaderIsHeapOnly(next_htup))
{
report_corruption(&ctx,
- psprintf("redirected line pointer points to a non-heap-only tuple at offset %u",
- (unsigned) nextoffnum));
+ psprintf("redirected line pointer points to a non-heap-only tuple at offset %d",
+ nextoffnum));
}
/* HOT chains should not intersect. */
if (predecessor[nextoffnum] != InvalidOffsetNumber)
{
report_corruption(&ctx,
- psprintf("redirect line pointer points to offset %u, but offset %u also points there",
- (unsigned) nextoffnum, (unsigned) predecessor[nextoffnum]));
+ psprintf("redirect line pointer points to offset %d, but offset %d also points there",
+ nextoffnum, predecessor[nextoffnum]));
continue;
}
if (predecessor[nextoffnum] != InvalidOffsetNumber)
{
report_corruption(&ctx,
- psprintf("tuple points to new version at offset %u, but offset %u also points there",
- (unsigned) nextoffnum, (unsigned) predecessor[nextoffnum]));
+ psprintf("tuple points to new version at offset %d, but offset %d also points there",
+ nextoffnum, predecessor[nextoffnum]));
continue;
}
HeapTupleHeaderIsHeapOnly(next_htup))
{
report_corruption(&ctx,
- psprintf("non-heap-only update produced a heap-only tuple at offset %u",
- (unsigned) nextoffnum));
+ psprintf("non-heap-only update produced a heap-only tuple at offset %d",
+ nextoffnum));
}
if ((curr_htup->t_infomask2 & HEAP_HOT_UPDATED) &&
!HeapTupleHeaderIsHeapOnly(next_htup))
{
report_corruption(&ctx,
- psprintf("heap-only update produced a non-heap only tuple at offset %u",
- (unsigned) nextoffnum));
+ psprintf("heap-only update produced a non-heap only tuple at offset %d",
+ nextoffnum));
}
/*
TransactionIdIsInProgress(curr_xmin))
{
report_corruption(&ctx,
- psprintf("tuple with in-progress xmin %u was updated to produce a tuple at offset %u with committed xmin %u",
- (unsigned) curr_xmin,
- (unsigned) ctx.offnum,
- (unsigned) next_xmin));
+ psprintf("tuple with in-progress xmin %u was updated to produce a tuple at offset %d with committed xmin %u",
+ curr_xmin,
+ ctx.offnum,
+ next_xmin));
}
/*
{
if (xmin_commit_status[nextoffnum] == XID_IN_PROGRESS)
report_corruption(&ctx,
- psprintf("tuple with aborted xmin %u was updated to produce a tuple at offset %u with in-progress xmin %u",
- (unsigned) curr_xmin,
- (unsigned) ctx.offnum,
- (unsigned) next_xmin));
+ psprintf("tuple with aborted xmin %u was updated to produce a tuple at offset %d with in-progress xmin %u",
+ curr_xmin,
+ ctx.offnum,
+ next_xmin));
else if (xmin_commit_status[nextoffnum] == XID_COMMITTED)
report_corruption(&ctx,
- psprintf("tuple with aborted xmin %u was updated to produce a tuple at offset %u with committed xmin %u",
- (unsigned) curr_xmin,
- (unsigned) ctx.offnum,
- (unsigned) next_xmin));
+ psprintf("tuple with aborted xmin %u was updated to produce a tuple at offset %d with committed xmin %u",
+ curr_xmin,
+ ctx.offnum,
+ next_xmin));
}
}
value != NULL ? " = \"" : "",
value != NULL ? value : "",
value != NULL ? "\"" : "",
- (unsigned int) (attributeP->atttypid),
+ attributeP->atttypid,
attributeP->attlen,
attributeP->atttypmod,
attributeP->attbyval ? 't' : 'f');
int i;
char *walbuf = ((char *) insertData) + sizeof(ginxlogRecompressDataLeaf);
- appendStringInfo(buf, " %d segments:", (int) insertData->nactions);
+ appendStringInfo(buf, " %d segments:", insertData->nactions);
for (i = 0; i < insertData->nactions; i++)
{
s->name ? s->name : "unnamed",
BlockStateAsString(s->blockState),
TransStateAsString(s->state),
- (unsigned int) XidFromFullTransactionId(s->fullTransactionId),
- (unsigned int) s->subTransactionId,
- (unsigned int) currentCommandId,
+ XidFromFullTransactionId(s->fullTransactionId),
+ s->subTransactionId,
+ currentCommandId,
currentCommandIdUsed ? " (used)" : "",
buf.data)));
pfree(buf.data);
if (!blk->has_data && blk->data_len != 0)
{
report_invalid_record(state,
- "BKPBLOCK_HAS_DATA not set, but data length is %u at %X/%08X",
- (unsigned int) blk->data_len,
+ "BKPBLOCK_HAS_DATA not set, but data length is %d at %X/%08X",
+ blk->data_len,
LSN_FORMAT_ARGS(state->ReadRecPtr));
goto err;
}
blk->bimg_len == BLCKSZ))
{
report_invalid_record(state,
- "BKPIMAGE_HAS_HOLE set, but hole offset %u length %u block image length %u at %X/%08X",
- (unsigned int) blk->hole_offset,
- (unsigned int) blk->hole_length,
- (unsigned int) blk->bimg_len,
+ "BKPIMAGE_HAS_HOLE set, but hole offset %d length %d block image length %d at %X/%08X",
+ blk->hole_offset,
+ blk->hole_length,
+ blk->bimg_len,
LSN_FORMAT_ARGS(state->ReadRecPtr));
goto err;
}
(blk->hole_offset != 0 || blk->hole_length != 0))
{
report_invalid_record(state,
- "BKPIMAGE_HAS_HOLE not set, but hole offset %u length %u at %X/%08X",
- (unsigned int) blk->hole_offset,
- (unsigned int) blk->hole_length,
+ "BKPIMAGE_HAS_HOLE not set, but hole offset %d length %d at %X/%08X",
+ blk->hole_offset,
+ blk->hole_length,
LSN_FORMAT_ARGS(state->ReadRecPtr));
goto err;
}
blk->bimg_len == BLCKSZ)
{
report_invalid_record(state,
- "BKPIMAGE_COMPRESSED set, but block image length %u at %X/%08X",
- (unsigned int) blk->bimg_len,
+ "BKPIMAGE_COMPRESSED set, but block image length %d at %X/%08X",
+ blk->bimg_len,
LSN_FORMAT_ARGS(state->ReadRecPtr));
goto err;
}
blk->bimg_len != BLCKSZ)
{
report_invalid_record(state,
- "neither BKPIMAGE_HAS_HOLE nor BKPIMAGE_COMPRESSED set, but block image length is %u at %X/%08X",
- (unsigned int) blk->data_len,
+ "neither BKPIMAGE_HAS_HOLE nor BKPIMAGE_COMPRESSED set, but block image length is %d at %X/%08X",
+ blk->data_len,
LSN_FORMAT_ARGS(state->ReadRecPtr));
goto err;
}
ereport(ERROR,
(errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
errmsg("row field count is %d, expected %d",
- (int) fld_count, attr_count)));
+ fld_count, attr_count)));
foreach(cur, cstate->attnumlist)
{
switch (nodeTag(def->arg))
{
case T_Integer:
- return psprintf("%ld", (long) intVal(def->arg));
+ return psprintf("%d", intVal(def->arg));
case T_Float:
return castNode(Float, def->arg)->fval;
case T_Boolean:
if (!*ldap)
{
ereport(LOG,
- (errmsg("could not initialize LDAP: error code %d",
- (int) LdapGetLastError())));
+ (errmsg("could not initialize LDAP: error code %lu",
+ LdapGetLastError())));
return STATUS_ERROR;
}
saved_errno == EADDRINUSE ?
(addr->ai_family == AF_UNIX ?
errhint("Is another postmaster already running on port %d?",
- (int) portNumber) :
+ portNumber) :
errhint("Is another postmaster already running on port %d?"
" If not, wait a few seconds and retry.",
- (int) portNumber)) : 0));
+ portNumber)) : 0));
closesocket(fd);
continue;
}
ereport(LOG,
/* translator: first %s is IPv4 or IPv6 */
(errmsg("listening on %s address \"%s\", port %d",
- familyDesc, addrDesc, (int) portNumber)));
+ familyDesc, addrDesc, portNumber)));
ListenSockets[*NumListenSockets] = fd;
(*NumListenSockets)++;
edata->funcname = pstrdup(value);
break;
default:
- elog(ERROR, "unrecognized error field code: %d", (int) code);
+ elog(ERROR, "unrecognized error field code: %d", code);
break;
}
}
if (IsA(&ac->val, Integer))
{
- cstr = psprintf("%ld", (long) intVal(&ac->val));
+ cstr = psprintf("%d", intVal(&ac->val));
}
else if (IsA(&ac->val, Float))
{
ereport(PANIC,
(errcode_for_file_access(),
errmsg("could not write to WAL segment %s "
- "at offset %d, length %lu: %m",
- xlogfname, startoff, (unsigned long) segbytes)));
+ "at offset %d, length %d: %m",
+ xlogfname, startoff, segbytes)));
}
/* Update state for write */
offset != MAXALIGN(offset))
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
- errmsg("corrupted line pointer: offset = %u, size = %u",
- offset, (unsigned int) oldsize)));
+ errmsg("corrupted line pointer: offset = %u, size = %d",
+ offset, oldsize)));
/*
* Determine actual change in space requirement, check for page overflow.
if (typmodout == InvalidOid)
{
/* Default behavior: just print the integer typmod with parens */
- res = psprintf("%s(%d)", typname, (int) typmod);
+ res = psprintf("%s(%d)", typname, typmod);
}
else
{
if (toklen >= MAXSTRLEN)
ereturn(escontext, (Datum) 0,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("word is too long (%ld bytes, max %ld bytes)",
- (long) toklen,
- (long) (MAXSTRLEN - 1))));
+ errmsg("word is too long (%d bytes, max %d bytes)",
+ toklen,
+ MAXSTRLEN - 1)));
if (cur - tmpbuf > MAXSTRPOS)
ereturn(escontext, (Datum) 0,
TransactionId transactionId = PG_GETARG_TRANSACTIONID(0);
char *result = (char *) palloc(16);
- snprintf(result, 16, "%lu", (unsigned long) transactionId);
+ snprintf(result, 16, "%u", transactionId);
PG_RETURN_CSTRING(result);
}
CommandId c = PG_GETARG_COMMANDID(0);
char *result = (char *) palloc(16);
- snprintf(result, 16, "%lu", (unsigned long) c);
+ snprintf(result, 16, "%u", c);
PG_RETURN_CSTRING(result);
}
if (!CreateRestrictedProcess(cmd, &pi, false))
{
write_stderr(_("%s: could not start server: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
exit(1);
}
/* Don't close command process handle here; caller must do so */
CloseServiceHandle(hSCM);
write_stderr(_("%s: could not register service \"%s\": error code %lu\n"),
progname, register_servicename,
- (unsigned long) GetLastError());
+ GetLastError());
exit(1);
}
CloseServiceHandle(hService);
CloseServiceHandle(hSCM);
write_stderr(_("%s: could not open service \"%s\": error code %lu\n"),
progname, register_servicename,
- (unsigned long) GetLastError());
+ GetLastError());
exit(1);
}
if (!DeleteService(hService))
CloseServiceHandle(hSCM);
write_stderr(_("%s: could not unregister service \"%s\": error code %lu\n"),
progname, register_servicename,
- (unsigned long) GetLastError());
+ GetLastError());
exit(1);
}
CloseServiceHandle(hService);
{
write_stderr(_("%s: could not start service \"%s\": error code %lu\n"),
progname, register_servicename,
- (unsigned long) GetLastError());
+ GetLastError());
exit(1);
}
}
* it doesn't cast DWORD before printing.
*/
write_stderr(_("%s: could not open process token: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
return 0;
}
0, &dropSids[1].Sid))
{
write_stderr(_("%s: could not allocate SIDs: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
return 0;
}
if (!b)
{
write_stderr(_("%s: could not create restricted token: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
return 0;
}
HANDLE job;
char jobname[128];
- sprintf(jobname, "PostgreSQL_%lu",
- (unsigned long) processInfo->dwProcessId);
+ sprintf(jobname, "PostgreSQL_%lu", processInfo->dwProcessId);
job = CreateJobObject(NULL, jobname);
if (job)
!LookupPrivilegeValue(NULL, SE_CHANGE_NOTIFY_NAME, &luidChangeNotify))
{
write_stderr(_("%s: could not get LUIDs for privileges: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
return NULL;
}
GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
write_stderr(_("%s: could not get token information: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
return NULL;
}
if (!GetTokenInformation(hToken, TokenPrivileges, tokenPrivs, length, &length))
{
write_stderr(_("%s: could not get token information: error code %lu\n"),
- progname, (unsigned long) GetLastError());
+ progname, GetLastError());
free(tokenPrivs);
return NULL;
}
if (errno != 0 || badp == sep + 1 || *badp != '\0')
pg_fatal("invalid weight specification: %s", sep);
if (wtmp > INT_MAX || wtmp < 0)
- pg_fatal("weight specification out of range (0 .. %d): %lld",
- INT_MAX, (long long) wtmp);
+ pg_fatal("weight specification out of range (0 .. %d): %ld",
+ INT_MAX, wtmp);
weight = wtmp;
}
else
if (pset.logfile)
fprintf(pset.logfile, "%s\n", cmdstatus);
- snprintf(buf, sizeof(buf), "%u", (unsigned int) PQoidValue(result));
+ snprintf(buf, sizeof(buf), "%u", PQoidValue(result));
SetVariable(pset.vars, "LASTOID", buf);
}