1 Reply Latest reply on Jun 30, 2020 9:33 AM by Bertrand Martin

    Issue with PostgreSQL query

    shareef ahamed
      Share This:

      Related query is :

      SELECT datname, xact_commit + xact_rollback AS number FROM pg_stat_database

       

      But this number is a counter, and does not reflect the real number of active transactions.

       

      # SELECT datname, xact_commit + xact_rollback AS number FROM pg_stat_database

      ;

      +-----------+------------+

      |  datname  |   number   |

      +-----------+------------+

      | postgres  |    1902031 |

      | template1 |     329450 |

      | template0 |     304764 |

      | pcbutmp1  | 1632509190 |

      +-----------+------------+

       

      Could you help with right query so that reflect the real number of active transactions using MonitoringStudio