Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Masahiro Ikeda
On 2023-08-21 13:34, Michael Paquier wrote: On Mon, Aug 21, 2023 at 11:33:28AM +0900, Kyotaro Horiguchi wrote: I'm not sure about others, but I would avoid using the name "current_database" for the variable. Agreed. Looking at the surroundings, we have for example "datname" in the collation t

Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Michael Paquier
On Mon, Aug 21, 2023 at 11:33:28AM +0900, Kyotaro Horiguchi wrote: > I'm not sure about others, but I would avoid using the name > "current_database" for the variable. Agreed. Looking at the surroundings, we have for example "datname" in the collation tests so I have just used that, and applied t

Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Masahiro Ikeda
On 2023-08-21 11:33, Kyotaro Horiguchi wrote: On 2023/08/15 14:13, Masahiro Ikeda wrote: On 2023-08-15 11:48, Masahiko Sawada wrote: +COMMENT ON DATABASE :current_database IS 'This is a test comment'; -- insert or update in 'pg_shdescription' I think the current_database should be quoted (see

Re: Fix pg_stat_reset_single_table_counters function

2023-08-20 Thread Kyotaro Horiguchi
Apologies. In the previous mail, I mistakenly addressed it to the wrong recipients. Reposted. On 2023/08/15 14:13, Masahiro Ikeda wrote: On 2023-08-15 11:48, Masahiko Sawada wrote: +COMMENT ON DATABASE :current_database IS 'This is a test comment'; -- insert or update in 'pg_shdescription' I

Re: Fix pg_stat_reset_single_table_counters function

2023-08-14 Thread Masahiro Ikeda
On 2023-08-15 11:48, Masahiko Sawada wrote: On Mon, Aug 14, 2023 at 5:12 PM Masahiro Ikeda wrote: I changed the table to check the stats from pg_database to pg_shdescription because the stats can update via the SQL interface COMMENT command. It seems to work well. +COMMENT ON DATABASE :curre

Re: Fix pg_stat_reset_single_table_counters function

2023-08-14 Thread Masahiko Sawada
Hi, On Mon, Aug 14, 2023 at 5:12 PM Masahiro Ikeda wrote: > > Hi, > > On 2023-08-13 04:12, Andres Freund wrote: > > On 2023-08-10 17:48:10 +0900, Masahiko Sawada wrote: > >> Good catch! I've confirmed that the issue has been fixed by your > >> patch. > > > > Indeed. > > Thanks for your responses!

Re: Fix pg_stat_reset_single_table_counters function

2023-08-14 Thread Masahiro Ikeda
Hi, On 2023-08-13 04:12, Andres Freund wrote: On 2023-08-10 17:48:10 +0900, Masahiko Sawada wrote: Good catch! I've confirmed that the issue has been fixed by your patch. Indeed. Thanks for your responses! However, I'm not sure the added regression tests are stable since autovacuum worker

Re: Fix pg_stat_reset_single_table_counters function

2023-08-12 Thread Andres Freund
Hi, On 2023-08-10 17:48:10 +0900, Masahiko Sawada wrote: > Good catch! I've confirmed that the issue has been fixed by your patch. Indeed. > However, I'm not sure the added regression tests are stable since > autovacuum workers may scan the pg_database and increment the > statistics after reset

Re: Fix pg_stat_reset_single_table_counters function

2023-08-10 Thread Masahiko Sawada
On Thu, Aug 10, 2023 at 2:10 PM Masahiro Ikeda wrote: > > On 2023-08-01 15:23, Masahiro Ikeda wrote: > > Hi, > > > > My colleague, Mitsuru Hinata (in CC), found the following issue. > > > > The documentation of pg_stat_reset_single_table_counters() says > >> pg_stat_reset_single_table_counters ( o

Re: Fix pg_stat_reset_single_table_counters function

2023-08-09 Thread Masahiro Ikeda
On 2023-08-01 15:23, Masahiro Ikeda wrote: Hi, My colleague, Mitsuru Hinata (in CC), found the following issue. The documentation of pg_stat_reset_single_table_counters() says pg_stat_reset_single_table_counters ( oid ) → void Resets statistics for a single table or index in the current databa