Skip to content

Commit 694b4ab

Browse files
committed
pg_buffercache: Fix incorrect result cast for relforknumber
pg_buffercache_pages.relforknumber is defined as an int2, but its value was stored with ObjectIdGetDatum() rather than Int16GetDatum() in the result record. Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://postgr.es/m/CAExHW5s2_qwSdhKpVnUzjRMf0cf1PvmhUHQDLaFM3QzKbP1OyQ@mail.gmail.com
1 parent fce1342 commit 694b4ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
263263
nulls[2] = false;
264264
values[3] = ObjectIdGetDatum(fctx->record[i].reldatabase);
265265
nulls[3] = false;
266-
values[4] = ObjectIdGetDatum(fctx->record[i].forknum);
266+
values[4] = Int16GetDatum(fctx->record[i].forknum);
267267
nulls[4] = false;
268268
values[5] = Int64GetDatum((int64) fctx->record[i].blocknum);
269269
nulls[5] = false;

0 commit comments

Comments
 (0)