Skip to content

Commit 390ed56

Browse files
committed
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.
1 parent d0f8d0d commit 390ed56

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/backend/access/heap/tuptoaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ toast_open_indexes(Relation toastrel,
21522152
* wrong if there is nothing.
21532153
*/
21542154
if (!found)
2155-
elog(ERROR, "no valid index found for toast relation with Oid %d",
2155+
elog(ERROR, "no valid index found for toast relation with Oid %u",
21562156
RelationGetRelid(toastrel));
21572157

21582158
return res;

src/backend/postmaster/pgstat.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,7 @@ pgstat_write_statsfiles(bool permanent, bool allDbs)
36003600
const char *statfile = permanent ? PGSTAT_STAT_PERMANENT_FILENAME : pgstat_stat_filename;
36013601
int rc;
36023602

3603-
elog(DEBUG2, "writing statsfile '%s'", statfile);
3603+
elog(DEBUG2, "writing stats file \"%s\"", statfile);
36043604

36053605
/*
36063606
* Open the statistics temp file to write out the current values.
@@ -3777,7 +3777,7 @@ pgstat_write_db_statsfile(PgStat_StatDBEntry *dbentry, bool permanent)
37773777
get_dbstat_filename(permanent, true, dbid, tmpfile, MAXPGPATH);
37783778
get_dbstat_filename(permanent, false, dbid, statfile, MAXPGPATH);
37793779

3780-
elog(DEBUG2, "writing statsfile '%s'", statfile);
3780+
elog(DEBUG2, "writing stats file \"%s\"", statfile);
37813781

37823782
/*
37833783
* Open the statistics temp file to write out the current values.
@@ -3858,7 +3858,7 @@ pgstat_write_db_statsfile(PgStat_StatDBEntry *dbentry, bool permanent)
38583858
{
38593859
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
38603860

3861-
elog(DEBUG2, "removing temporary stat file '%s'", statfile);
3861+
elog(DEBUG2, "removing temporary stats file \"%s\"", statfile);
38623862
unlink(statfile);
38633863
}
38643864
}
@@ -4070,7 +4070,7 @@ pgstat_read_statsfiles(Oid onlydb, bool permanent, bool deep)
40704070
/* If requested to read the permanent file, also get rid of it. */
40714071
if (permanent)
40724072
{
4073-
elog(DEBUG2, "removing permanent stats file '%s'", statfile);
4073+
elog(DEBUG2, "removing permanent stats file \"%s\"", statfile);
40744074
unlink(statfile);
40754075
}
40764076

@@ -4228,7 +4228,7 @@ pgstat_read_db_statsfile(Oid databaseid, HTAB *tabhash, HTAB *funchash,
42284228

42294229
if (permanent)
42304230
{
4231-
elog(DEBUG2, "removing permanent stats file '%s'", statfile);
4231+
elog(DEBUG2, "removing permanent stats file \"%s\"", statfile);
42324232
unlink(statfile);
42334233
}
42344234

@@ -4540,7 +4540,7 @@ pgstat_recv_inquiry(PgStat_MsgInquiry *msg, int len)
45404540
DBWriteRequest *newreq;
45414541
PgStat_StatDBEntry *dbentry;
45424542

4543-
elog(DEBUG2, "received inquiry for %d", msg->databaseid);
4543+
elog(DEBUG2, "received inquiry for database %u", msg->databaseid);
45444544

45454545
/*
45464546
* 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)
45984598
writetime = pstrdup(timestamptz_to_str(dbentry->stats_timestamp));
45994599
mytime = pstrdup(timestamptz_to_str(cur_ts));
46004600
elog(LOG,
4601-
"stats_timestamp %s is later than collector's time %s for db %d",
4601+
"stats_timestamp %s is later than collector's time %s for database %u",
46024602
writetime, mytime, dbentry->databaseid);
46034603
pfree(writetime);
46044604
pfree(mytime);
@@ -4770,7 +4770,7 @@ pgstat_recv_dropdb(PgStat_MsgDropdb *msg, int len)
47704770

47714771
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
47724772

4773-
elog(DEBUG2, "removing %s", statfile);
4773+
elog(DEBUG2, "removing stats file \"%s\"", statfile);
47744774
unlink(statfile);
47754775

47764776
if (dbentry->tables != NULL)

src/backend/replication/logical/reorderbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2457,7 +2457,7 @@ ReorderBufferToastAppendChunk(ReorderBuffer *rb, ReorderBufferTXN *txn,
24572457
Pointer chunk;
24582458
TupleDesc desc = RelationGetDescr(relation);
24592459
Oid chunk_id;
2460-
Oid chunk_seq;
2460+
int32 chunk_seq;
24612461

24622462
if (txn->toast_hash == NULL)
24632463
ReorderBufferToastInitHash(rb, txn);

src/bin/pg_dump/parallel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ lockTableNoWait(ArchiveHandle *AH, TocEntry *te)
816816
" pg_class.relname "
817817
" FROM pg_class "
818818
" JOIN pg_namespace on pg_namespace.oid = relnamespace "
819-
" WHERE pg_class.oid = %d", te->catalogId.oid);
819+
" WHERE pg_class.oid = %u", te->catalogId.oid);
820820

821821
res = PQexec(AH->connection, query->data);
822822

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy