aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_buffercache/pg_buffercache_pages.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2025-04-08 11:52:02 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2025-04-08 12:38:42 +0200
commit91f1fe90c7d42641201bd2c474bd86d703b5e830 (patch)
treecc9c4e0ab7a980120ab4e4af144ec7e5f186f816 /contrib/pg_buffercache/pg_buffercache_pages.c
parentb8a6078ca8f446a6271b26101de75ee48e288a3a (diff)
downloadpostgresql-91f1fe90c7d42641201bd2c474bd86d703b5e830.tar.gz
postgresql-91f1fe90c7d42641201bd2c474bd86d703b5e830.zip
pg_buffercache: Change page_num type to bigint
The page_num was defined as integer, which should be sufficient for the near future (with 4K pages it's 8TB). But it's virtually free to return bigint, and get a wider range. This was agreed on the thread, but I forgot to tweak this in ba2a3c2302f1. While at it, make the data types in CREATE VIEW a bit more consistent. Discussion: https://postgr.es/m/CAKZiRmxh6KWo0aqRqvmcoaX2jUxZYb4kGp3N%3Dq1w%2BDiH-696Xw%40mail.gmail.co
Diffstat (limited to 'contrib/pg_buffercache/pg_buffercache_pages.c')
-rw-r--r--contrib/pg_buffercache/pg_buffercache_pages.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pg_buffercache/pg_buffercache_pages.c b/contrib/pg_buffercache/pg_buffercache_pages.c
index 54c83601418..c9ceba604b1 100644
--- a/contrib/pg_buffercache/pg_buffercache_pages.c
+++ b/contrib/pg_buffercache/pg_buffercache_pages.c
@@ -72,7 +72,7 @@ typedef struct
typedef struct
{
uint32 bufferid;
- int32 page_num;
+ int64 page_num;
int32 numa_node;
} BufferCacheNumaRec;
@@ -414,7 +414,7 @@ pg_buffercache_numa_pages(PG_FUNCTION_ARGS)
TupleDescInitEntry(tupledesc, (AttrNumber) 1, "bufferid",
INT4OID, -1, 0);
TupleDescInitEntry(tupledesc, (AttrNumber) 2, "os_page_num",
- INT4OID, -1, 0);
+ INT8OID, -1, 0);
TupleDescInitEntry(tupledesc, (AttrNumber) 3, "numa_node",
INT4OID, -1, 0);
@@ -522,7 +522,7 @@ pg_buffercache_numa_pages(PG_FUNCTION_ARGS)
values[0] = Int32GetDatum(fctx->record[i].bufferid);
nulls[0] = false;
- values[1] = Int32GetDatum(fctx->record[i].page_num);
+ values[1] = Int64GetDatum(fctx->record[i].page_num);
nulls[1] = false;
values[2] = Int32GetDatum(fctx->record[i].numa_node);