From: legrand legrand <legrand_legrand@hotmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: pg_stat_statements: rows not updated for CREATE TABLE AS SELECT statements
Date: Fri, 27 Mar 2020 10:43:15 -0700 (MST)
Message-ID: <1585330995153-0.post@n3.nabble.com> (raw)
In-Reply-To: <c9463107-d605-9d9e-54e5-f065f2fc3c1f@oss.nttdata.com>
References: <1584293755198-0.post@n3.nabble.com>
<c9463107-d605-9d9e-54e5-f065f2fc3c1f@oss.nttdata.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: legrand_legrand@hotmail.com
Subject: Re: pg_stat_statements: rows not updated for CREATE TABLE AS SELECT statements
In-Reply-To: <1585330995153-0.post@n3.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox