Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lglCW-0005xg-Uj for pgsql-hackers@arkaria.postgresql.org; Wed, 12 May 2021 09:30:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lglBz-00043t-E1 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 May 2021 09:30:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lglBz-00043l-42 for pgsql-hackers@lists.postgresql.org; Wed, 12 May 2021 09:30:11 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lglBs-0006ko-Kk for pgsql-hackers@lists.postgresql.org; Wed, 12 May 2021 09:30:10 +0000 Received: by mail-pj1-x1033.google.com with SMTP id gj14so13203624pjb.5 for ; Wed, 12 May 2021 02:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RZCWAgNfvprnmUo6CNC8J0gSxTolrIANn7JYkV6vlMk=; b=i1oLRzJzt8cTj9zPJLTffs5takORs/lTTplpnZhhZ0EGkmtpGEf65yzJM4uorEzsBj 3riqsexq80WB8y4bFsmWMKRiGV8dOdxc4DUJKEauSQdFZck598D8EMOlt4nVqeUbwcGk weD/9zZ4tb/xAegyyanBpZEvzlqe8HYijVi/0qOo4f07f7XGBHwCP0KT14idJmQoNnsn i/MRf0WLIRP04T2Rq7wI4SLee2I3aCHLQ/GQPD/vWOiJD4mM+g7ONEbUB8N0OFZzF9R1 EQWpstj7t85AfKOUtsjWiA+uFFWDQtQi5bfHacMQOq/Oy5I+qEtSz4JZ6uhX/Lljxymi Sjmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RZCWAgNfvprnmUo6CNC8J0gSxTolrIANn7JYkV6vlMk=; b=X+VCEwpgaA2gVGlsK5ZeeqHEo538xrpjt2ehhqbCrUCkKHIcxpaqhCc7v1bnhgR/OW 5XdKG97FkHXk8Hu+RwC8YBtl7qXjt6JjuJxOdJ9JkxbvGpk4C2W+zjj2c97ZeMJsRuzW Ehe3VUxkzy8GnwKShOGxVNGPwhllKlT44ZF+omfd1HkYvTOYjw9chbOZQSW81DAoibrB nVdieagFAjwDlMVswSl7ArO3rbxO3kD50uO984hU1veyUqJvo3OIbTtX/igf4zVAVs85 OGgwFIeLRxO5hkNlSJYxWVPtnbU5WNtqAJ3Qbtz3yMrF4mZq50ryEePuSxlaLaFnlTu3 EUzA== X-Gm-Message-State: AOAM5335ViIOY/6O9NNaSsm/YyCFxfQUW0KyJrcd3yXdUMgvGTrqz8mN F4CYO3JAXDjKt6liW9AEssM= X-Google-Smtp-Source: ABdhPJxN3Tbcrt4PtXCtlnyoS9TpwriNzPKMKuuqCTjpCiM7rYxTxAPbPEmLKmks+qSLNgUsjSli9w== X-Received: by 2002:a17:90a:d710:: with SMTP id y16mr10191378pju.86.1620811801462; Wed, 12 May 2021 02:30:01 -0700 (PDT) Received: from nol (2001-b011-0008-929a-d1b5-2d99-2ba7-4d91.dynamic-ip6.hinet.net. [2001:b011:8:929a:d1b5:2d99:2ba7:4d91]) by smtp.gmail.com with ESMTPSA id p19sm15406130pff.206.2021.05.12.02.29.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 02:30:00 -0700 (PDT) Date: Wed, 12 May 2021 17:30:26 +0800 From: Julien Rouhaud To: Pavel Stehule Cc: Kyotaro Horiguchi , Magnus Hagander , Fujii Masao , Michael Paquier , Andres Freund , Tom Lane , Alvaro Herrera , Stephen Frost , Bruce Momjian , Christoph Berg , Peter Eisentraut , PostgreSQL Hackers Subject: Re: compute_query_id and pg_stat_statements Message-ID: <20210512093026.ur43cu3c46eshbew@nol> References: <20210512.110836.2162399537656469720.horikyota.ntt@gmail.com> <20210512024201.ak3ofofakn2ymhiv@nol> <20210512.143335.1053382893089496881.horikyota.ntt@gmail.com> <20210512061049.dykngnivdoesquxb@nol> <20210512071339.hl2wrf7gfuvjnbm4@nol> <20210512081445.axosz3xf7ydrhe7o@nol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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!