Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-20 Thread Fujii Masao
On 2025/04/18 18:45, Fujii Masao wrote: On 2025/04/18 18:23, David Rowley wrote: On Fri, 18 Apr 2025 at 20:54, Fujii Masao wrote: Shouldn't the example output of pg_log_backend_memory_contexts() in the documentation also be updated to use 1-based numbering for consistency? Patch attached.

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-18 Thread Fujii Masao
On 2025/04/18 18:23, David Rowley wrote: On Fri, 18 Apr 2025 at 20:54, Fujii Masao wrote: Shouldn't the example output of pg_log_backend_memory_contexts() in the documentation also be updated to use 1-based numbering for consistency? Patch attached. Yeah. I failed to notice we had an examp

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-18 Thread David Rowley
On Fri, 18 Apr 2025 at 20:54, Fujii Masao wrote: > Shouldn't the example output of pg_log_backend_memory_contexts() in > the documentation also be updated to use 1-based numbering for consistency? > Patch attached. Yeah. I failed to notice we had an example of the output. Want to take care of it

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-18 Thread Fujii Masao
On 2025/04/18 6:11, David Rowley wrote: On Fri, 18 Apr 2025 at 00:25, Rahila Syed wrote: Regarding v2 patch, - int level = 0; Retaining the level variable will enhance the code readability, IMO. When I read that, I suspected it might have been left

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-18 Thread David Rowley
On Fri, 18 Apr 2025 at 00:25, Rahila Syed wrote: > Regarding v2 patch, > - int level = 0; > > Retaining the level variable will enhance the code readability, IMO. When I read that, I suspected it might have been leftover from a refactor during the develop

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-17 Thread torikoshia
Thanks for your review, Melih and Rahila. On 2025-04-17 21:25, Rahila Syed wrote: Hi, The attached patch is how I think we should do it. Thank you for the patch. I tested this patch and it works fine. I agree with the changes made in it. Regarding v2 patch, - int

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-17 Thread Rahila Syed
Hi, > The attached patch is how I think we should do it. > Thank you for the patch. I tested this patch and it works fine. I agree with the changes made in it. Regarding v2 patch, - int level = 0; Retaining the level variable will enhance the code rea

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-17 Thread Melih Mutlu
Hi, torikoshia , 17 Nis 2025 Per, 12:35 tarihinde şunu yazdı: > I guess few people would notice this difference, but I think it's better > to avoid changing it unless there's a good reason to do so. > Personally, I also feel the original formatting better -- especially > because the "xx more chil

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-17 Thread torikoshia
On 2025-04-17 07:31, David Rowley wrote: On Thu, 17 Apr 2025 at 02:20, torikoshia wrote: Regarding the implementation: In the initial patch attached, I naïvely incremented the level just before emitting the log line. However, it might be cleaner to simply initialize the level variable to 1 fr

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-16 Thread David Rowley
On Thu, 17 Apr 2025 at 02:20, torikoshia wrote: > Regarding the implementation: > In the initial patch attached, I naïvely incremented the level just > before emitting the log line. > However, it might be cleaner to simply initialize the level variable to > 1 from the start. This could help avoid

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-16 Thread torikoshia
On 2025-04-16 06:18, Daniel Gustafsson wrote: On 15 Apr 2025, at 23:03, David Rowley wrote: My vote is to make the levels 1-based in all locations where we output the context information. I agree with this, pg_get_process_memory_contexts() also use 1-based levels fwiw. +1. I believe the

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-15 Thread Daniel Gustafsson
> On 15 Apr 2025, at 23:03, David Rowley wrote: > My vote is to make the levels 1-based in all locations where we output > the context information. I agree with this, pg_get_process_memory_contexts() also use 1-based levels fwiw. -- Daniel Gustafsson

Re: Align memory context level numbering in pg_log_backend_memory_contexts()

2025-04-15 Thread David Rowley
On Wed, 16 Apr 2025 at 01:23, torikoshia wrote: >=# select name, level from pg_backend_memory_contexts; > name | level >+--- > TopMemoryContext | 1 >=# select pg_log_backend_memory_contexts(pg_backend_pid());