Re: What's the best practice to compare the transaction with the checkpoint?

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: What's the best practice to compare the transaction with the checkpoint?
Дата
Msg-id 0bf46f63bd9f7e57a83710644a0ed4cf5f6c52f0.camel@cybertec.at
обсуждение исходный текст
Ответ на What's the best practice to compare the transaction with the checkpoint?  (Jialun Zhang <reatank@gmail.com>)
Ответы Re: What's the best practice to compare the transaction with the checkpoint?
Список pgsql-novice
On Sat, 2020-07-04 at 12:19 -0400, Jialun Zhang wrote:
> I am trying to add code to determine whether the transaction is checkpointed or not.
> So I think I need to compare the transaction ID with the checkpoint's and determine
> whether it is older or not. Could anyone tell me what's the best practice of doing
> this in Postgres? Is it done somewhere in the existing code?

You could use

   SELECT next_xid FROM pg_control_checkpoint();

to get information about the last checkpoint.

I refrain from asking what the point of the exercise is...

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




В списке pgsql-novice по дате отправления:

Предыдущее
От: Jialun Zhang
Дата:
Сообщение: What's the best practice to compare the transaction with the checkpoint?
Следующее
От: Jialun Zhang
Дата:
Сообщение: Re: What's the best practice to compare the transaction with the checkpoint?