Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_catalog.txid_current() is too big for an integer. #89

Open
Nickuru opened this issue Jan 9, 2025 · 1 comment
Open

pg_catalog.txid_current() is too big for an integer. #89

Nickuru opened this issue Jan 9, 2025 · 1 comment
Assignees
Labels

Comments

@Nickuru
Copy link

Nickuru commented Jan 9, 2025

After upgrade to pg-16 now powa UI shows me an issue:

Error retrieving datasource data pg_replication_slots: value "12079118176" is out of range for type xid CONTEXT: PL/pgSQL function public.powa_replication_slots_src(integer) line 10 at assignment

Error retrieving datasource data pg_stat_activity: value "12079118176" is out of range for type xid CONTEXT: PL/pgSQL function public.powa_stat_activity_src(integer) line 9 at assignment

After checking the functions I figured out that yes, txid is bigger than integer limit.

powa=# select pg_catalog.txid_current()
;
 txid_current
--------------
  12079118176
(1 row)

It seems functions scripts are required to be fixed.

@rjuju rjuju self-assigned this Jan 9, 2025
@rjuju rjuju added the bug label Jan 9, 2025
@rjuju
Copy link
Member

rjuju commented Jan 9, 2025

Hi,

Thanks for the report!

indeed, I didn't noticed that txid_current() returns a full transaction id (aka xid8) while the rest of the fields in pg_replication_slots and pg_stat_activity only return xid.

The goal of returning the current transaction id is to be able to compare it to the fields in the associated view. Since there is no way to transform an xid to an xid8 (at least that I know of) on the assumption that it's on the current xid epoch,the fix will have to be to downgrade the xid8 to xid for the current transaction id.

I will work on a fix shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants