Downgrade pgsql 17 to pgsql 12 question

From: Ashish Mukherjee <ashish(dot)mukherjee(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Downgrade pgsql 17 to pgsql 12 question
Date: 2025-09-26 12:18:07
Message-ID: CACgMzfxO7h+Bj4T8rjTV=trM3+Uw=jOAcUE+0Kimv4DSAVU1JA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a strange requirement to downgrade from pgsql 17 to pgsql 12. This
is because we found in production certain incompatibilities between both
versions for our database. It should have been caught in testing but was
not.

The clean way seems to be text file dump and restore but this would be too
huge and too slow for our database of 3T. If I use pg_dump v17 and then
restore with pg_restore v 17 on a pgsql v12 database, is there any risk? I
tried a small test with a bunch of tables and it worked, but am wondering
about the pitfalls. I am restoring from the directory format dump.

When I do dump/restore like this for a test table, I get the following
errors during restore but the table gets restored fine.

pg_restore: error: while PROCESSING TOC:
error: pg_restore: error: pg_restore: from TOC entry 17168; 1259
58572315 TABLE pkgs s14
pg_restore: error: pg_restore: pg_restore: pg_restore: from TOC entry
17168; 1259 58572315 TABLE pkgs s14
pg_restore: error: pg_restore: from TOC entry 17168; 1259 58572315 TABLE
pkgs s14
pg_restore: error: pg_restore: from TOC entry 17168; 1259 58572315 TABLE
pkgs s14
error: from TOC entry 17168; 1259 58572315 TABLE pkgs s14
pg_restore: warning: errors ignored on restore: 2

pkgs is the table and s14 is my database

Any input would be appreciated.

Regards,
Ashish

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2025-09-26 12:47:48 Re: pgpass file in postresql.auto.conf?
Previous Message Dan Mahoney (Gushi) 2025-09-26 12:05:58 pgpass file in postresql.auto.conf?