I want to upgrade a Postgres 9.6 database on CloudSQL (GCP) up to version 13. As SQL export/import is the only supported upgrade path, I've exported the PG9.6 database and attempted to import it into a new PG13 instance.
The import fails with the following error though:
ERROR: function public.pg_stat_statements_reset() does not exist
I figured it's triggered by the following line in the dump:
GRANT ALL ON FUNCTION public.pg_stat_statements_reset() TO somerandomuser;
When I try to execute that single line manually on the new PG13 instance, I'm getting the error as well. The same happens on PG12.
On PG11 though, it works fine.
I've made sure the pg_stat_statements
extension is installed in all tested DB instances:
SELECT * FROM pg_available_extensions WHERE name = 'pg_stat_statements' and installed_version is not null;
name | default_version | installed_version | comment
--------------------+-----------------+-------------------+------------------------------------------------------------------------
pg_stat_statements | 1.8 | 1.8 | track planning and execution statistics of all SQL statements executed
(1 row)
I couldn't find any documentation about a breaking change affecting this. Any ideas on why it is not working?
SECURITY DEFINER
function.