> The utility commands for cursor like DECLARE CURSOR seem to have the same issue
> and can cause lots of pgss entries. For example, when we use postgres_fdw and
> execute "SELECT * FROM <foreign table> WHERE id = 10" five times in the same
> transaction, the following commands are executed in the remote PostgreSQL server
> and recorded as pgss entries there.
> DECLARE c1 CURSOR FOR ...
> DECLARE c2 CURSOR FOR ...
> DECLARE c3 CURSOR FOR ...
+1
I also made this observation recently and have a patch to suggest
to improve tis situation. I will start a separate thread for this.
Regards,
--
Sami Imseih
Amazon Web Services (AWS)