Use pg_current_xact_id() instead of deprecated txid_current() - Mailing list pgsql-hackers

From Shinya Kato
Subject Use pg_current_xact_id() instead of deprecated txid_current()
Date
Msg-id CAOzEurQetW=-1+OnMo8baeVQF=-kAr-wNtFcgRNo+ErPk=xsDQ@mail.gmail.com
Whole thread
Responses Re: Use pg_current_xact_id() instead of deprecated txid_current()
List pgsql-hackers
Hi hackers,

Commit 4c04be9b05a [0] introduced xid8-based functions to replace the
txid_XXX family.  However, several test files were still using
txid_current() instead of the newer pg_current_xact_id().  Attached
patch replaces all remaining call sites in tests.

Since pg_current_xact_id() returns xid8 which does not support
arithmetic operators, places that need "xid + 1" cast the result via
::text::bigint first.

[0] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4c04be9b05ad2ec5acd27c3417bf075c13cab134

-- 
Best regards,
Shinya Kato
NTT OSS Center

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Add 64-bit XIDs into PostgreSQL 15
Next
From: Amit Kapila
Date:
Subject: Re: Skipping schema changes in publication