Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHt0r-0008FE-GV for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Mar 2020 17:43:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHt0q-0002Pb-9o for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Mar 2020 17:43:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHt0p-0002PU-Ui for pgsql-bugs@lists.postgresql.org; Fri, 27 Mar 2020 17:43:20 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jHt0m-0007yY-P6 for pgsql-bugs@postgresql.org; Fri, 27 Mar 2020 17:43:18 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 2607C1C0A8977 for ; Fri, 27 Mar 2020 10:43:15 -0700 (MST) Date: Fri, 27 Mar 2020 10:43:15 -0700 (MST) From: legrand legrand To: pgsql-bugs@postgresql.org Message-ID: <1585330995153-0.post@n3.nabble.com> In-Reply-To: References: <1584293755198-0.post@n3.nabble.com> Subject: Re: pg_stat_statements: rows not updated for CREATE TABLE AS SELECT statements MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you for those answers ! > The utility commands that return CMDTAG_SELECT are > only CREATE TABLE AS SELECT and CREATE MATERIALIZED VIEW? > I'd just like to confirm that there is no case where "rows" must not > be counted when CMDTAG_SELECT is returned. I don't have any in mind ... > BTW, "rows" should be updated when FETCH or MOVE is executed > because each command returns or affects the rows? Yes they should, but they aren't yet (event with CMDTAG_SELECT added) Note that implicit cursors behave the same way ;o( postgres=# do $$ declare i integer; begin for i in (select 1 ) loop null; end loop;end; $$; DO postgres=# select calls,query,rows from pg_stat_statements; calls | query | rows -------+---------------------------------------------------------------------------------+------ 1 | select pg_stat_statements_reset() | 1 1 | (select $1 ) | 0 1 | do $$ declare i integer; begin for i in (select 1 ) loop null; end loop;end; $$ | 0 (3 rows) Regards PAscal -- Sent from: https://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html