Re: Least Active Transaction ID function - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Least Active Transaction ID function
Date
Msg-id CA+TgmobcDFbKRfuMk5e9XwcU4-q2pgv2+S+XS63cFGqvfGD=5w@mail.gmail.com
Whole thread Raw
In response to Re: Least Active Transaction ID function  (Rohit Goyal <rhtgyl.87@gmail.com>)
Responses Re: Least Active Transaction ID function  (Rohit Goyal <rhtgyl.87@gmail.com>)
List pgsql-hackers
On Wed, Jul 23, 2014 at 3:53 PM, Rohit Goyal <rhtgyl.87@gmail.com> wrote:
> Hi All,
>
> On Wed, Jul 23, 2014 at 5:01 PM, Rohit Goyal <rhtgyl.87@gmail.com> wrote:
>>
>> Hi All,
>>
>> I am doing programming with postgresql source code. I want to find out the
>> function which can give me Least active transaction id currenty in the
>> system.
>>
>> Is there any function which can give me that?
>>
>> Regards,
>> Rohit Goyal
>
> 1> I know that somewhere there is an active transaction list in postgresql.
> At any point of time, I want to get the smallest transaction present in this
> active tx list or I want to get the transaction id before which all
> transaction smaller than that are committed/aborted.
>
> Is there any function which can give me this value?

See the RecentXmin calculation in GetSnapshotData.

> 2> I found a function giving GetStableLatestTransactionId(), please tel me
> what this function gives. I was not able to understand the description given
> above it.

I don't know how to help with this; the description seems clear to me.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: gaussian distribution pgbench -- splits Bv6
Next
From: Robert Haas
Date:
Subject: Re: Verbose output of pg_dump not show schema name