1

Looking to install the pgstattuple extension on my Postgres 12 DB on RHEL 7 to see index fragmentation. Currently I only have one extension installed and that's the plpgsql extension.

Executing 'CREATE EXTENSION pgstattuple' results in the following error:

SQL Error [58P01]: ERROR: could not open extension control file "/usr/pgsql-12/share/extension/pgstattuple.control": No such file or directory

And I verified that the pgstattuple.control is not located in the /usr/pgsql-12/share/extension folder.

Searching around the net, seemed to indicate that the postgresql-contrib needed to be installed to get the pgstattuple extension. So I did the following command:

$  sudo yum install postgresql-contrib

Unfortunately the yum install postgresql-contrib resulted in the pgstattuple and other extensions being installed into the /usr/pgsql-9.6/share/extension folder, and not in the /usr/pgsql-12/share/extension folder where I want them.

For giggles, I tried copying all the pgstattuple* files in /usr/pgsql-9.6/share/extension to /usr/pgsql-12/share/extension folder, and then tried calling CREATE extension pgstattuple, but that didn't work with another error.

Questions are:

  1. Should I expect sudo yum install postgresql-contrib to actually install the pgstattuple extension for Postgres 12?? Or is there some other package name for Postgres 12?
  2. Could this be some problem with my Red Hat Repository configuration?
  3. In general what's the command to install the pgstattuple extension for Postgres 12 so that the pgstattuple files will end up in /usr/pgsql-12/share/extension folder??

Really appreciate any suggestions you have.

Thank you.

Jack Allen
  • 103
  • 1
  • 7

0 Answers0