<p>I have a Postgis database deployed on a Kubernetes cluster, using <a href="https://hub.docker.com/r/postgis/postgis" rel="nofollow noreferrer">this</a> image: <code>docker pull postgis/postgis:13-3.1</code>.</p>
<p>I was trying to solve this error:</p>
<pre><code>2021-06-29 03:20:50.958 UTC [2852] ERROR:  relation &quot;pg_stat_statements&quot; does not exist at character 536
2021-06-29 03:20:50.958 UTC [2852] STATEMENT:  SELECT t2.rolname, t3.datname, queryid, calls, total_time / 1000 as total_time_seconds, min_time / 1000 as min_time_seconds, max_time / 1000 as max_time_seconds, mean_time / 1000 as mean_time_seconds, stddev_time / 1000 as stddev_time_seconds, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, blk_read_time / 1000 as blk_read_time_seconds, blk_write_time / 1000 as blk_write_time_seconds FROM pg_stat_statements t1 JOIN pg_roles t2 ON (t1.userid=t2.oid) JOIN pg_database t3 ON (t1.dbid=t3.oid) WHERE t2.rolname != 'rdsadmin'
</code></pre>
<p>So I installed the missing extension in all my dbs, like so:</p>
<pre><code>psql -U $PG_USER \
  -d $DATABSE \
  -c &quot;CREATE EXTENSION pg_stat_statements SCHEMA public&quot;

psql -U $PG_USER \
  -d $DATABSE \
  -c &quot;CREATE EXTENSION pg_stat_statements SCHEMA pg_catalog&quot;
</code></pre>
<p>I'm now getting this error:</p>
<pre><code>2021-06-29 20:04:46.870 UTC [331] ERROR:  column &quot;total_time&quot; does not exist at character 48
2021-06-29 20:04:46.870 UTC [331] STATEMENT:  SELECT t2.rolname, t3.datname, queryid, calls, total_time / 1000 as total_time_seconds, min_time / 1000 as min_time_seconds, max_time / 1000 as max_time_seconds, mean_time / 1000 as mean_time_seconds, stddev_time / 1000 as stddev_time_seconds, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, blk_read_time / 1000 as blk_read_time_seconds, blk_write_time / 1000 as blk_write_time_seconds FROM pg_stat_statements t1 JOIN pg_roles t2 ON (t1.userid=t2.oid) JOIN pg_database t3 ON (t1.dbid=t3.oid) WHERE t2.rolname != 'rdsadmin'
</code></pre>
<p>I've tried to find the reason why, but haven't found anything helpful anywhere. Any ideias on how to solve this issue?</p>
<p>Postgres version: <code>psql (PostgreSQL) 13.2 (Debian 13.2-1.pgdg100+1)</code></p>
<p>Config file:</p>
<pre><code># ...
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.max = 1000
pg_stat_statements.track = all
# ...
</code></pre>

doublethink13
<p>That query is coming from some monitoring tool; which as far as I can tell has nothing to do with postgis.  The monitoring tool is out of date, as now that column is called &quot;total_exec_time&quot;.  (It was renamed when columns were added for planning times as well as for execution times.)</p>
