Re: compute_query_id and pg_stat_statements

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: rjuju123(at)gmail(dot)com
Cc: pavel(dot)stehule(at)gmail(dot)com, magnus(at)hagander(dot)net, masao(dot)fujii(at)oss(dot)nttdata(dot)com, michael(at)paquier(dot)xyz, andres(at)anarazel(dot)de, tgl(at)sss(dot)pgh(dot)pa(dot)us, alvherre(at)alvh(dot)no-ip(dot)org, sfrost(at)snowman(dot)net, bruce(at)momjian(dot)us, myon(at)debian(dot)org, peter(dot)eisentraut(at)enterprisedb(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: compute_query_id and pg_stat_statements
Date: 2021-05-12 09:42:31
Message-ID: 20210512.184231.761902431669199592.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 12 May 2021 18:39:27 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> At Wed, 12 May 2021 17:30:26 +0800, Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote in
> > On Wed, May 12, 2021 at 10:57:25AM +0200, Pavel Stehule wrote:
> > >
> > > My second proposal can work for your example too. pg_stat_statements have
> > > to require any active queryid computing. And when it is not available, then
> > > the exception should be raised.
> > >
> > > The custom queryid can return null, and still the queryid will be computed.
> > > Maybe the warning can be enough. Just, if somebody use pg_stat_statements
> > > function, then enforce the check if queryid is computed (compute_query_id
> > > is true || some hook is not null), and if not then raise a warning.
> >
> > Ah I'm sorry I misunderstood your proposal. Yes, definitely adding a warning
> > or an error when executing pg_stat_statements() SRF would help, that's a great
> > idea!
> >
> > I'll wait a bit in case someone has any objection, and if not send an updated
> > patch!
>
> Isn't there a case where pg_stat_statements uses an alternative
> query-id provider?

I don't object that if we allow false non-error when an extension that
uses the hooks but doesn't compute a query id.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2021-05-12 09:44:56 Re: Inherited UPDATE/DELETE vs async execution
Previous Message Pavel Stehule 2021-05-12 09:42:12 Re: compute_query_id and pg_stat_statements