Re: Resetting spilled txn statistics in pg_stat_replication

From: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>
To: "Shinoda, Noriyoshi (PN Japan A&PS Delivery)" <noriyoshi(dot)shinoda(at)hpe(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ajin Cherian <itsajin(at)gmail(dot)com>
Subject: Re: Resetting spilled txn statistics in pg_stat_replication
Date: 2020-10-13 00:10:51
Message-ID: CA+fd4k4iqy2cKV3U=s3AvyqLL+y8tjrpWNMGqRiZgnZ-a_p4FA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(Please avoid top-posting)

On Mon, 12 Oct 2020 at 23:45, Shinoda, Noriyoshi (PN Japan A&PS
Delivery) <noriyoshi(dot)shinoda(at)hpe(dot)com> wrote:
>
> Sawada-san, Thank you your comments.
>
> The attached patch reflects the comment.
> I also made a fix for the regression test.
>
> Regards,
> Noriyoshi Shinoda
>
> -----Original Message-----
> From: Masahiko Sawada [mailto:masahiko(dot)sawada(at)2ndquadrant(dot)com]
> Sent: Monday, October 12, 2020 8:12 PM
> To: Shinoda, Noriyoshi (PN Japan A&PS Delivery) <noriyoshi(dot)shinoda(at)hpe(dot)com>
> Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>; Dilip Kumar <dilipbalaut(at)gmail(dot)com>; Magnus Hagander <magnus(at)hagander(dot)net>; Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>; PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>; Ajin Cherian <itsajin(at)gmail(dot)com>
> Subject: Re: Resetting spilled txn statistics in pg_stat_replication
>
> On Mon, 12 Oct 2020 at 18:29, Shinoda, Noriyoshi (PN Japan A&PS
> Delivery) <noriyoshi(dot)shinoda(at)hpe(dot)com> wrote:
> >
> > Hi, thank you for the awesome feature.
> >
>
> Thank you for reporting!
>
> > As it may have been discussed, I think the 'name' column in pg_stat_replication_slots is more consistent with the column name and data type matched to the pg_replication_slots catalog.
> > The attached patch changes the name and data type of the 'name' column to slot_name and 'name' type, respectively.
>
> It seems a good idea to me. In other system views, we use the name data type for object name. When I wrote the first patch, I borrowed the code for pg_stat_slru which uses text data for the name but I think it's an oversight.

Hmm, my above observation is wrong. All other statistics use text data
type and internally use char[NAMEDATALEN]. So I think renaming to
'slot_name' would be a good idea but probably we don’t need to change
the internally used data type. For the data type of slot_name of
pg_stat_replication_slots view, given that the doc says the
following[1], I think we can keep it too as this view is not a system
catalog. What do you think?

8.3. Character Types:
The name type exists only for the storage of identifiers in the
internal system catalogs

[1] https://www.postgresql.org/docs/devel/datatype-character.html

Regards,

--
Masahiko Sawada http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-10-13 00:25:07 Re: BUG #15858: could not stat file - over 4GB
Previous Message Masahiko Sawada 2020-10-12 23:23:50 Re: Resetting spilled txn statistics in pg_stat_replication