Turn TransactionIdRetreat/Advance into inline functions
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t46755psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 28, 2026 at 01:53 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t46755_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t46755_1 && git checkout t46755_1Patchset v1 (message #1) is on t46755_1
Hi!
This patch is inspired by [0]/messages/by-id/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com and many others.
I've notice recent activity to convert macros into inline functions. We
should make TransactionIdRetreat/Advance functions
Instead of a macro, should we?
I also think about NormalTransactionIdPrecedes and
NormalTransactionIdFollows, but maybe, they should be addressed
separately: the comment says that "this is a macro for speed".
Any thoughts?
[0]: /messages/by-id/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com
/messages/by-id/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com
--
Best regards,
Maxim Orlov.
Maxim Orlov <orlovmg@gmail.com> writes:
I've notice recent activity to convert macros into inline functions. We
should make TransactionIdRetreat/Advance functions
Instead of a macro, should we?
-1. Having to touch all the call sites like this outweighs
any claimed advantage: it makes them uglier and it will greatly
complicate any back-patching we might have to do in those areas.
regards, tom lane
-1. Having to touch all the call sites like this outweighs
any claimed advantage: it makes them uglier and it will greatly
complicate any back-patching we might have to do in those areas.regards, tom lane
Ok, got it. But what if we change the semantics of these calls to
xid = TransactionIdAdvance(xid) ?
--
Best regards,
Maxim Orlov.
Maxim Orlov <orlovmg@gmail.com> writes:
-1. Having to touch all the call sites like this outweighs
any claimed advantage: it makes them uglier and it will greatly
complicate any back-patching we might have to do in those areas.
Ok, got it. But what if we change the semantics of these calls to
xid = TransactionIdAdvance(xid) ?
Uh ... you'd still have to touch all the call sites.
regards, tom lane