1

I'm using pg_repack extension to perform full vacuum on my database tables. Till now , I was using postgres-11. Now, I have upgraded it to postgres-12.4. After upgrading when I started doing full vacuum again- I got below error:

   ERROR: pg_repack failed with error: ERROR:  column "relhasoids" does not exist

Here are in detail:

    pg_repack  -U postgres --no-order --no-kill-backend  --table channatest shiwangini

   ERROR: pg_repack failed with error: ERROR:  column "relhasoids" does not exist
   LINE 19:         CASE WHEN relhasoids
                       ^
   QUERY:
   SELECT array_to_string(array_agg(param), ', ')
   FROM (
   -- table storage parameter
   SELECT unnest(reloptions) as param
   FROM pg_

How can I avoid this problem in postgres -12 version? I have tried with installing pg_repack12 already and pg_repack version 1.4.5 only installed on my machine which has support for postgres -12. Still the same error.

     /usr/pgsql-12/bin/pg_repack --version

     pg_repack 1.4.5
Channa
  • 742
  • 17
  • 28

2 Answers2

0

PostgreSQL v12 has done away with the relhasoids column of the pg_class catalog, because the undelying concept does no longer exist in v12.

You should use version 1.4.5 or better of pg_repack, where support for PostgreSQL v12 was added.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • pg_repack version 1.4.5 only installed on my machine. Still getting the same issue. I'm editing my question with more details – Channa Sep 09 '20 at 15:51
  • Then it is not installed properly. I looked at the source, and it replaces `relhasoids` with `false` in v12. Perhaps you ran `configure` with an older version of PosttgreSQL. – Laurenz Albe Sep 09 '20 at 15:57
  • I uninstalled older version of repack and installed new one using this commad: sudo yum install pg_repack12 ..still same issue :( – Channa Sep 10 '20 at 19:14
  • Strange. Perhaps open an issue with the project. – Laurenz Albe Sep 11 '20 at 02:18
0

My problem fixed with latest pg_repack release on 30th sept 2020. pg_repack 1.4.6.

Here is what I did:

  • Uninstall/Remove all old installation.
  • Installed new version of pg_repack. -- sudo yum install pg_repack12
  • Connected to database dropped the existing extension and created a new one. drop extension pg_repack ; create extension pg_repack ;
  • Re-run repack. This time I was able to repack successfully.
Channa
  • 742
  • 17
  • 28