Re: equivalent of @@TRANCOUNT PostgreSQL - Mailing list pgsql-admin

From MichaelDBA
Subject Re: equivalent of @@TRANCOUNT PostgreSQL
Date
Msg-id 43af0a07-99df-6125-4227-ce1c22bd1fb8@sqlexec.com
Whole thread Raw
In response to Re: equivalent of @@TRANCOUNT PostgreSQL  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: equivalent of @@TRANCOUNT PostgreSQL
List pgsql-admin
I don't think so, it's not current active transactions, but number of active transactions on the CURRENT CONNECTION.  No way you get that from pg_stat_activity.  So if your proc had a bunch of embedded BEGIN/END blocks, it would be that count.

David G. Johnston wrote on 5/29/2021 10:44 AM:
One transaction per process actively executing a query.

pgsql-admin by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: equivalent of @@TRANCOUNT PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: equivalent of @@TRANCOUNT PostgreSQL