Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: sk(at)zsrv(dot)org
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Date: 2018-07-04 10:12:32
Message-ID: CAJrrPGf=REEMM7PK37L_2BY5+xAoZjo=joHXkvU+3tg+i71-LA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 2, 2018 at 6:42 PM Sergei Kornilov <sk(at)zsrv(dot)org> wrote:

> Hello
>

Thanks for the review.

> I found SELECT pg_stat_statements_reset(NULL,NULL,s.queryid) in tests and
> it pass tests, but i wonder how it works. Should not we check the NULL
> through PG_ARGISNULL macro before any PG_GETARG_*? According
> src/include/fmgr.h
> > * If function is not marked "proisstrict" in pg_proc, it must check for
> > * null arguments using this macro. Do not try to GETARG a null argument!
>

Thanks for checking, Added.

> > pg_stat_statements_reset(userid Oid, dbid Oid, queryid bigint) returns
> void
> And you forgot to change return type in docs (and description of return
> value)
>

Corrected and also added details of the returns value.

Update patch attached.

Regards,
Haribabu Kommi
Fujitsu Australia

Attachment Content-Type Size
0001-pg_stat_statements_reset-to-reset-specific-query-use_v3.patch application/x-patch 18.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2018-07-04 11:55:53 Re: [HACKERS] WAL logging problem in 9.4.3?
Previous Message Ashutosh Bapat 2018-07-04 10:11:35 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.