Re: Add new option 'all' to pg_stat_reset_shared()

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, boekewurm+postgres(at)gmail(dot)com, Michael Paquier <michael(at)paquier(dot)xyz>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Date: 2023-11-08 08:45:24
Message-ID: CALj2ACW4Fqc_m+OaavrOMEivZ5aBa24pVKvoXRTmuFECsNBfAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 8, 2023 at 9:43 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> > 2.
> > +{ oid => '8000',
> > + descr => 'statistics: reset collected statistics shared across the cluster',
> > + proname => 'pg_stat_reset_shared', provolatile => 'v', prorettype => 'void',
> > + proargtypes => '', prosrc => 'pg_stat_reset_shared_all' },
> >
> > Why a new function consuming the oid? Why can't we just do the trick
> > of proisstrict => 'f' and if (PG_ARGISNULL(0)) { reset all stats} else
> > {reset specified stats kind} like the pg_stat_reset_slru()?
>
> It's not like oids are a precious resource. It's a more confusing API to have
> to have to specify a NULL as an argument than not having to do so. If we
> really want to avoid a separate oid, a more sensible path would be to add a
> default argument to pg_stat_reset_slru() (by doing a CREATE OR REPLACE in
> system_functions.sql).

+1. Attached the patch.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Add-no-argument-support-for-pg_stat_reset_slru.text text/plain 4.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-11-08 08:57:44 Re: Synchronizing slots from primary to standby
Previous Message Peter Eisentraut 2023-11-08 08:41:19 Re: Remove MSVC scripts from the tree