Re: why pg_walfile_name() cannot be executed during recovery?
От | Andrey Borodin |
---|---|
Тема | Re: why pg_walfile_name() cannot be executed during recovery? |
Дата | |
Msg-id | A7002722-492F-44F9-9AEE-DA031C443307@yandex-team.ru обсуждение исходный текст |
Ответ на | Re: why pg_walfile_name() cannot be executed during recovery? (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>) |
Ответы |
Re: why pg_walfile_name() cannot be executed during recovery?
|
Список | pgsql-hackers |
> On 9 Apr 2022, at 18:30, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote: > > Using insert tli when not in recovery and using tli of the last WAL > replayed record in crash/archive/standby recovery, seems a reasonable > choice to me. Please excuse me if I'm not attentive enough. I've read this thread. And I could not find what is the problem that you aresolving. What is the purpose of the WAL file name you want to obtain? pg_walfile_name() - is a formatting function. With TLI as an hidden argument. If we want it to work on Standby we shouldjust convert it to pure formatting function without access the the DB state, pass TLI as an argument. Making implicit TLI computation with certain expectations is not a good idea IMV. pg_walfile_name() could just read .history file, determine which TLI contains given LSN and format the name. And still there'sa tricky segments during TLI switch. Either way we can rename the function to pg_walfile_name_as_if_on_timeline_of_last_wal_replayed(). Thanks! Best regards, Andrey Borodin.
В списке pgsql-hackers по дате отправления: