Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-25 Thread Andrey Borodin
> 22 апр. 2022 г., в 19:15, Bharath Rupireddy > написал(а): > > On Sat, Apr 9, 2022 at 10:21 PM Robert Haas wrote: >> >> On Sat, Apr 9, 2022 at 12:25 PM Andrey Borodin wrote: >>> Please excuse me if I'm not attentive enough. I've read this thread. And I >>> could not find what is the

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-22 Thread Bharath Rupireddy
On Sat, Apr 9, 2022 at 10:21 PM Robert Haas wrote: > > On Sat, Apr 9, 2022 at 12:25 PM Andrey Borodin wrote: > > 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 are solving. What is the > > purpose of the WAL file name

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-09 Thread Robert Haas
On Sat, Apr 9, 2022 at 12:25 PM Andrey Borodin wrote: > 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 are solving. What is the purpose > of the WAL file name you want to obtain? Yeah, I'd also like to know this. --

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-09 Thread Andrey Borodin
> On 9 Apr 2022, at 18:30, Bharath Rupireddy > 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

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-09 Thread Bharath Rupireddy
On Fri, Apr 8, 2022 at 7:28 PM Robert Haas wrote: > > On Fri, Apr 8, 2022 at 9:31 AM Bharath Rupireddy > wrote: > > Fundamental question - should the pg_walfile_{name, name_offset} check > > whether the file with the computed WAL file name exists on the server > > right now or ever existed

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-08 Thread Robert Haas
On Fri, Apr 8, 2022 at 9:31 AM Bharath Rupireddy wrote: > Fundamental question - should the pg_walfile_{name, name_offset} check > whether the file with the computed WAL file name exists on the server > right now or ever existed earlier? Right now, they don't do that, see > [1]. I don't think

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-08 Thread Bharath Rupireddy
On Thu, Apr 7, 2022 at 9:07 PM Robert Haas wrote: > > On Thu, Apr 7, 2022 at 9:32 AM Bharath Rupireddy > wrote: > > I spent some time today to allow pg_walfile_{name, name_offset} run in > > recovery. Timeline ID is computed while in recovery as follows - WAL > > receiver's last received and

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-07 Thread Michael Paquier
On Thu, Apr 07, 2022 at 11:37:15AM -0400, Robert Haas wrote: > It's also worth noting that there's a bit of a definitional problem > here. If in the same situation, I ask for pg_walfile_name('11/0'), > it's going to give me a filename based on TLI 2, but there's also a > WAL file for that LSN with

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-07 Thread Robert Haas
On Thu, Apr 7, 2022 at 9:32 AM Bharath Rupireddy wrote: > I spent some time today to allow pg_walfile_{name, name_offset} run in > recovery. Timeline ID is computed while in recovery as follows - WAL > receiver's last received and flushed WAL record's TLI if it's > streaming, otherwise the last

Re: why pg_walfile_name() cannot be executed during recovery?

2022-04-07 Thread Bharath Rupireddy
On Fri, Apr 2, 2021 at 5:52 PM Robert Haas wrote: > > On Fri, Apr 2, 2021 at 4:23 AM SATYANARAYANA NARLAPURAM > wrote: > > Why pg_walfile_name() can't be executed under recovery? > > I believe the issue is that the backend executing the function might > not have an accurate idea about which TLI

Re: why pg_walfile_name() cannot be executed during recovery?

2021-04-07 Thread Jehan-Guillaume de Rorthais
On Fri, 2 Apr 2021 08:22:09 -0400 Robert Haas wrote: > On Fri, Apr 2, 2021 at 4:23 AM SATYANARAYANA NARLAPURAM > wrote: > > Why pg_walfile_name() can't be executed under recovery? > > I believe the issue is that the backend executing the function might > not have an accurate idea about which

Re: why pg_walfile_name() cannot be executed during recovery?

2021-04-02 Thread Robert Haas
On Fri, Apr 2, 2021 at 4:23 AM SATYANARAYANA NARLAPURAM wrote: > Why pg_walfile_name() can't be executed under recovery? I believe the issue is that the backend executing the function might not have an accurate idea about which TLI to use. But I don't understand why we can't find some solution

why pg_walfile_name() cannot be executed during recovery?

2021-04-02 Thread SATYANARAYANA NARLAPURAM
Hello Hackers, Why pg_walfile_name() can't be executed under recovery? What is the best way for me to get the current timeline and/or the file being recovering on the standby using a postgres query? I know I can get it via process title but don't want to go that route. Thanks, Satya