Fix assorted confusion between Oid and int32.
In passing, also make some debugging elog's in pgstat.c a bit more consistently worded. Back-patch as far as applicable (9.3 or 9.4; none of these mistakes are really old). Mark Dilger identified and patched the type violations; the message rewordings are mine.
This commit is contained in:
parent
10eb7dfa9b
commit
06d5803ffa
@ -2155,7 +2155,7 @@ toast_open_indexes(Relation toastrel,
|
|||||||
* wrong if there is nothing.
|
* wrong if there is nothing.
|
||||||
*/
|
*/
|
||||||
if (!found)
|
if (!found)
|
||||||
elog(ERROR, "no valid index found for toast relation with Oid %d",
|
elog(ERROR, "no valid index found for toast relation with Oid %u",
|
||||||
RelationGetRelid(toastrel));
|
RelationGetRelid(toastrel));
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -3600,7 +3600,7 @@ pgstat_write_statsfiles(bool permanent, bool allDbs)
|
|||||||
const char *statfile = permanent ? PGSTAT_STAT_PERMANENT_FILENAME : pgstat_stat_filename;
|
const char *statfile = permanent ? PGSTAT_STAT_PERMANENT_FILENAME : pgstat_stat_filename;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
elog(DEBUG2, "writing statsfile '%s'", statfile);
|
elog(DEBUG2, "writing stats file \"%s\"", statfile);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open the statistics temp file to write out the current values.
|
* Open the statistics temp file to write out the current values.
|
||||||
@ -3777,7 +3777,7 @@ pgstat_write_db_statsfile(PgStat_StatDBEntry *dbentry, bool permanent)
|
|||||||
get_dbstat_filename(permanent, true, dbid, tmpfile, MAXPGPATH);
|
get_dbstat_filename(permanent, true, dbid, tmpfile, MAXPGPATH);
|
||||||
get_dbstat_filename(permanent, false, dbid, statfile, MAXPGPATH);
|
get_dbstat_filename(permanent, false, dbid, statfile, MAXPGPATH);
|
||||||
|
|
||||||
elog(DEBUG2, "writing statsfile '%s'", statfile);
|
elog(DEBUG2, "writing stats file \"%s\"", statfile);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open the statistics temp file to write out the current values.
|
* Open the statistics temp file to write out the current values.
|
||||||
@ -3858,7 +3858,7 @@ pgstat_write_db_statsfile(PgStat_StatDBEntry *dbentry, bool permanent)
|
|||||||
{
|
{
|
||||||
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
|
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
|
||||||
|
|
||||||
elog(DEBUG2, "removing temporary stat file '%s'", statfile);
|
elog(DEBUG2, "removing temporary stats file \"%s\"", statfile);
|
||||||
unlink(statfile);
|
unlink(statfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4070,7 +4070,7 @@ done:
|
|||||||
/* If requested to read the permanent file, also get rid of it. */
|
/* If requested to read the permanent file, also get rid of it. */
|
||||||
if (permanent)
|
if (permanent)
|
||||||
{
|
{
|
||||||
elog(DEBUG2, "removing permanent stats file '%s'", statfile);
|
elog(DEBUG2, "removing permanent stats file \"%s\"", statfile);
|
||||||
unlink(statfile);
|
unlink(statfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4228,7 +4228,7 @@ done:
|
|||||||
|
|
||||||
if (permanent)
|
if (permanent)
|
||||||
{
|
{
|
||||||
elog(DEBUG2, "removing permanent stats file '%s'", statfile);
|
elog(DEBUG2, "removing permanent stats file \"%s\"", statfile);
|
||||||
unlink(statfile);
|
unlink(statfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4540,7 +4540,7 @@ pgstat_recv_inquiry(PgStat_MsgInquiry *msg, int len)
|
|||||||
DBWriteRequest *newreq;
|
DBWriteRequest *newreq;
|
||||||
PgStat_StatDBEntry *dbentry;
|
PgStat_StatDBEntry *dbentry;
|
||||||
|
|
||||||
elog(DEBUG2, "received inquiry for %d", msg->databaseid);
|
elog(DEBUG2, "received inquiry for database %u", msg->databaseid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the last write request for this DB. If it's older than the
|
* Find the last write request for this DB. If it's older than the
|
||||||
@ -4598,7 +4598,7 @@ pgstat_recv_inquiry(PgStat_MsgInquiry *msg, int len)
|
|||||||
writetime = pstrdup(timestamptz_to_str(dbentry->stats_timestamp));
|
writetime = pstrdup(timestamptz_to_str(dbentry->stats_timestamp));
|
||||||
mytime = pstrdup(timestamptz_to_str(cur_ts));
|
mytime = pstrdup(timestamptz_to_str(cur_ts));
|
||||||
elog(LOG,
|
elog(LOG,
|
||||||
"stats_timestamp %s is later than collector's time %s for db %d",
|
"stats_timestamp %s is later than collector's time %s for database %u",
|
||||||
writetime, mytime, dbentry->databaseid);
|
writetime, mytime, dbentry->databaseid);
|
||||||
pfree(writetime);
|
pfree(writetime);
|
||||||
pfree(mytime);
|
pfree(mytime);
|
||||||
@ -4770,7 +4770,7 @@ pgstat_recv_dropdb(PgStat_MsgDropdb *msg, int len)
|
|||||||
|
|
||||||
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
|
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
|
||||||
|
|
||||||
elog(DEBUG2, "removing %s", statfile);
|
elog(DEBUG2, "removing stats file \"%s\"", statfile);
|
||||||
unlink(statfile);
|
unlink(statfile);
|
||||||
|
|
||||||
if (dbentry->tables != NULL)
|
if (dbentry->tables != NULL)
|
||||||
|
@ -2458,7 +2458,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
|
|||||||
Pointer chunk;
|
Pointer chunk;
|
||||||
TupleDesc desc = RelationGetDescr(relation);
|
TupleDesc desc = RelationGetDescr(relation);
|
||||||
Oid chunk_id;
|
Oid chunk_id;
|
||||||
Oid chunk_seq;
|
int32 chunk_seq;
|
||||||
|
|
||||||
if (txn->toast_hash == NULL)
|
if (txn->toast_hash == NULL)
|
||||||
ReorderBufferToastInitHash(rb, txn);
|
ReorderBufferToastInitHash(rb, txn);
|
||||||
|
@ -821,7 +821,7 @@ lockTableNoWait(ArchiveHandle *AH, TocEntry *te)
|
|||||||
" pg_class.relname "
|
" pg_class.relname "
|
||||||
" FROM pg_class "
|
" FROM pg_class "
|
||||||
" JOIN pg_namespace on pg_namespace.oid = relnamespace "
|
" JOIN pg_namespace on pg_namespace.oid = relnamespace "
|
||||||
" WHERE pg_class.oid = %d", te->catalogId.oid);
|
" WHERE pg_class.oid = %u", te->catalogId.oid);
|
||||||
|
|
||||||
res = PQexec(AH->connection, query->data);
|
res = PQexec(AH->connection, query->data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user