| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Cc: | Bryan Green <dbryan(dot)green(at)gmail(dot)com> |
| Subject: | Switch buffile.c/h to use pgoff_t |
| Date: | 2025-12-19 01:43:10 |
| Message-ID: | aUStrqoOCDRFAq1M@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi all,
(Added Bryan in CC as he has been looking at this stuff previously.)
An mentioned on this thread and as a part of the quest to remove more
of long in the tree, buffile.c and buffile.h still rely on an
unportable off_t, which is signed 4 bytes on Windows:
https://www.postgresql.org/message-id/0f238ff4-c442-42f5-adb8-01b762c94ca1@gmail.com
Please find attached a patch to do the switch. I was surprised to see
that the amount of code to adapt was limited, the routines of
buffile.h changed in this commit being used in other places that keep
track of offsets. Hence these other files just need to do a off_t =>
pgoff_t flip in a couple of structures to be updated, as far as I can
see.
This removes a couple of extra long casts, as well as one comment in
BufFileSeek() that relates to overflows for large offsets, that would
not exist with this switch, which is nice.
Thanks,
--
Michael
| Attachment | Content-Type | Size |
|---|---|---|
| 0001-Switch-buffile.c-h-to-use-portable-pgoff_t.patch | text/x-diff | 8.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2025-12-19 01:53:53 | Re: Report bytes and transactions actually sent downtream |
| Previous Message | Mihail Nikalayeu | 2025-12-19 01:24:00 | Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY |