Re: proposal: get oldest LSN - function

From: Kartyshov Ivan <i(dot)kartyshov(at)postgrespro(dot)ru>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: get oldest LSN - function
Date: 2016-03-11 13:35:08
Message-ID: 56E2C98C.7030502@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11.03.2016 16:33, Kartyshov Ivan wrote:
>
>
> On 28.02.2016 11:36, Michael Paquier wrote:
>> On Sun, Feb 28, 2016 at 4:40 PM, Kartyshov Ivan wrote:
>>> It will not satisfy our purposes and our administrators for three
>>> reasons.
>>> 1) DBA set me task to get the oldest number that present in WAL, not
>>> last
>> Yeah I got that.
>>
>>> 2) Surely we can choose the oldest segment from list
>>> "pg_ls_dir('pg_xlog')"
>>> of segments and calculate the first LSN by hand, but it is not what
>>> we want
>>> to do manually.
>> That's where I am not following. In any case you are just one SQL
>> query away from the result. And actually your patch is incorrect I
>> think. If you care about the oldest record available you should look
>> for the first LSN position of the oldest segment, no? What you are
>> calculating now is the oldest virtual LSN position in local pg_xlog.
>
> Sorry, for long not answering and thank you for time you spent
> reviewing this patch, please clarify what you meen, when you say
> "virtual LSN position".
> In whole you are right, my main goal is to get the oldest LSN position
> in local pg_xlog, and i agree with you that it isn`t too hard to get
> it by SQL query. But it will be more usefull, to have easy access in
> userspace.
>
>

You wrote "If you care about the oldest record available you should look
for the first LSN position of the oldest segment, no?"
Yes I do it exactly this way.

--

--
Ivan Kartyshov
Postgres Professional: www.postgrespro.com
Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-03-11 13:35:21 Re: snapshot too old, configured by time
Previous Message Robert Haas 2016-03-11 13:33:31 Re: Improve error handling in pltcl