When I try to take a sample, I get the following error:
remote query result rowtype does not match the specified FROM clause rowtype
...
PL/pgSQL function collect_pg_stat_statements_stats(jsonb,integer,integer,integer) line 340 at SQL statement
SQL statement ""SELECT collect_pg_stat_statements_stats(server_properties, sserver_id, s_id, topn)""
PL/pgSQL function take_sample(integer,boolean) line 624 at PERFORM
PL/pgSQL assignment ""server_sampleres := take_sample(qres.server_id, NULL)""
PL/pgSQL function take_sample_subset(integer,integer) line 27 at assignment
SQL function ""take_sample"" statement 1
SQL function ""snapshot"" statement 1
",00:00:02.48)
I considered the collect_pg_stat_statements_stats function. During debugging, I saw that the following fields are used in the SELECT request on the server with pg_profile:
Where the data of 5 fields are not listed, which leads to an error. How can I avoid this error? Maybe I'm doing something wrong?
PostgreSQL and pg_profile version:
select * from pg_available_extensions where name = 'pg_profile';
-[ RECORD 1 ]-----+------------------------------------------------------
name | pg_profile
default_version | 4.7
installed_version | 4.7
comment | PostgreSQL load profile repository and report builder
select version();
-[ RECORD 1 ]-----------------------------------------------------------------------------------------------------
version | PostgreSQL 16.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3), 64-bit
I also attach the full code of the request that I received, on which I receive this error (the request inside dblink led to a readable form, and put down some fields - sserver_id, s_id):
When I try to take a sample, I get the following error:
I considered the collect_pg_stat_statements_stats function. During debugging, I saw that the following fields are used in the SELECT request on the server with pg_profile:
But the following fields are added to the request via dblink to those listed above:
All of them have a NULL value. But then comes the type conversion:
Where the data of 5 fields are not listed, which leads to an error. How can I avoid this error? Maybe I'm doing something wrong?
PostgreSQL and pg_profile version:
I also attach the full code of the request that I received, on which I receive this error (the request inside dblink led to a readable form, and put down some fields - sserver_id, s_id):