Re: pg_stat_database view column xact_commit description should be more descriptive?

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_stat_database view column xact_commit description should be more descriptive?
Date: 2022-06-03 07:31:18
Message-ID: CACJufxEUyFsV9e9Brc=0H8PQVE1qjP0J3+=Xq9d3oLt6WMC8Zw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Sorry.
It refers to all the transactions.

On Fri, Jun 3, 2022 at 12:30 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

>
>
> On Thursday, June 2, 2022, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
>>
>>
>> https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW
>>
>>> xact_commit bigint
>>>
>>> Number of transactions in this database that have been committed
>>>
>> In https://www.postgresql.org/docs/current/sql-begin.html
>>
>> BEGIN initiates a transaction block, that is, all statements after a
>>> BEGIN command will be executed in a single transaction until an
>>> explicit COMMIT
>>> <https://www.postgresql.org/docs/current/sql-commit.html> or ROLLBACK
>>> <https://www.postgresql.org/docs/current/sql-rollback.html> is given. By
>>> default (without BEGIN), PostgreSQL executes transactions in “autocommit
>>> ” mode, that is, each statement is executed in its own transaction and
>>> a commit is implicitly performed at the end of the statement (if
>>> execution was successful, otherwise a rollback is done).
>>>
>>
>> I guess the pg_stat_database view column *xact_commit *refers to
>> 'non-autocommit' transactions?
>> If so, should we say something like "Number of autocommit
>> transactions...."
>>
>
> My guess is that it doesn’t matter if it’s implicit or explicit and thus
> the documentation is correct and adequate. It does seem easy enough to
> prove one way or the other if you think it might be incorrect and thus to
> warrant a change to the docs. If it does vary I’d have reason to suspect
> that a pure select query would exhibit different behavior than an insert or
> delete query - i.e., whether a new xid is issued makes a difference.
>
> I may experiment myself when I’m back at a computer but as you are raising
> the potential issue the research seems like something that should be done
> to support the suggestion. It isn’t like this will require source code
> reading to discern.
>
> David J.
>
>

--
I recommend David Deutsch's <<The Beginning of Infinity>>

Jian

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2022-06-03 15:34:21 Re: Proposal to improve uniq function documentation in intarray extension
Previous Message David G. Johnston 2022-06-03 06:59:59 Re: pg_stat_database view column xact_commit description should be more descriptive?