pg_upgrade does not upgrade pg_stat_statements properly

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: pg_upgrade does not upgrade pg_stat_statements properly
Date: 2021-07-14 18:38:49
Message-ID: CADK3HHKawwbOcGwMGnDuAf3-U8YfvTcS8jqDv3UM=niijs3MMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Upgrading from
10.5 to 13.3 using pg_upgrade -k

The following is the result of an upgrade

select * from pg_extension ;
oid | extname | extowner | extnamespace | extrelocatable |
extversion | extconfig | extcondition
-------+--------------------+----------+--------------+----------------+------------+-----------+--------------
12910 | plpgsql | 10 | 11 | f |
1.0 | |
16403 | pg_stat_statements | 10 | 2200 | t |
1.5 | |
(2 rows)

test=# \df+ pg_stat_statements_reset

List of functions
Schema | Name | Result data type | Argument data types
| Type | Volatility | Parallel | Owner | Security | Access privileges
| Language | Source code | Description
--------+--------------------------+------------------+---------------------+------+------------+----------+-------+----------+---------------------------+----------+--------------------------+-------------
public | pg_stat_statements_reset | void |
| func | volatile | safe | davec | invoker | davec=X/davec
+| c | pg_stat_statements_reset |
| | |
| | | | | |
pg_read_all_stats=X/davec | | |
(1 row)

And this is from creating the extension in a new db on the same instance

foo=# select * from pg_extension ;
oid | extname | extowner | extnamespace | extrelocatable |
extversion | extconfig | extcondition
-------+--------------------+----------+--------------+----------------+------------+-----------+--------------
12910 | plpgsql | 10 | 11 | f |
1.0 | |
16393 | pg_stat_statements | 10 | 2200 | t |
1.8 | |
(2 rows)

foo=# \df+ pg_stat_statements_reset

List of functions
Schema | Name | Result data type |
Argument data types | Type | Volatility |
Parallel | Owner | Security | Access privileges | Language | Source
code | Description
--------+--------------------------+------------------+--------------------------------------------------------------------+------+------------+----------+-------+----------+-------------------+----------+------------------------------+-------------
public | pg_stat_statements_reset | void | userid oid DEFAULT
0, dbid oid DEFAULT 0, queryid bigint DEFAULT 0 | func | volatile | safe
| davec | invoker | davec=X/davec | c |
pg_stat_statements_reset_1_7 |
(1 row)

Notice the upgraded version is 1.5 and the new version is 1.8

I would think somewhere in the upgrade of the schema there should have been
a create extension pg_stat_statements ?

Dave
Dave Cramer

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2021-07-14 18:42:35 Re: CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers
Previous Message Euler Taveira 2021-07-14 18:30:15 Re: row filtering for logical replication