Re: Any way to get timestamp from LSN value ? - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Any way to get timestamp from LSN value ?
Date
Msg-id CALj2ACVgFvOQQEoyuuZeceQrStGsePWvU1noU5aAvJNenv8qTQ@mail.gmail.com
Whole thread Raw
In response to Any way to get timestamp from LSN value ?  (Harinath Kanchu <hkanchu@apple.com>)
List pgsql-hackers
On Thu, Jul 28, 2022 at 1:17 PM Harinath Kanchu <hkanchu@apple.com> wrote:
>
> Hello,
>
> Is there any way to get the timestamp of the transaction using LSN value ?
>
> For example:
> can we use the minimum recovery ending location in pg control file to get the minimum recovery timestamp ?
>
> Minimum recovery ending location:     28/28000B68

Can't pg_waldump be used? If you are on PG 15, you could as well use
pg_walinspect functions, something like below:

select * from pg_get_wal_records_info_till_end_of_wal(<<start_lsn>>)
where record_type like '%COMMIT%'

[1] https://www.postgresql.org/docs/15/pgwalinspect.html

-- 
Bharath Rupireddy
RDS Open Source Databases: https://aws.amazon.com/



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: small windows psqlrc re-wording
Next
From: Tom Lane
Date:
Subject: How come drongo didn't fail authentication here?