public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ashish Mukherjee <[email protected]>
To: Laurenz Albe <[email protected]>
Cc: [email protected]
Subject: Re: Downgrade pgsql 17 to pgsql 12 question
Date: Fri, 26 Sep 2025 20:17:12 +0530
Message-ID: <CACgMzfyYg=nuGcsLT8QPsPMTjoh-uzAo2u+F6F5ivWC4pq0yBQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CACgMzfxO7h+Bj4T8rjTV=trM3+Uw=jOAcUE+0Kimv4DSAVU1JA@mail.gmail.com>
	<[email protected]>

Thank you, Laurenz.

Yes, I say binary dump/restore would be faster because of the -j option.

Well, I suppose there's no certainty of what might break without going
through the whole process.

On Fri, Sep 26, 2025 at 7:57 PM Laurenz Albe <[email protected]>
wrote:

> On Fri, 2025-09-26 at 17:48 +0530, Ashish Mukherjee wrote:
> > 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?
>
> Yes, there is the risk that the restore will fail.
> Downgrading is not supported.
>
> That's why the best way to do it is a plain format dump: you can edit the
> dump file to manually fix any errors.
> I am surprised that you think that restoring a plain format dump would
> be significantly slower than restoring a different format (unless you are
> talking about parallel restore with -j).
>
> > 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.
>
> Anything can happen...
>
> > 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
>
> There should be more: the actual error messages.  These will give you a
> clue.
>
> Yours,
> Laurenz Albe
>


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Downgrade pgsql 17 to pgsql 12 question
  In-Reply-To: <CACgMzfyYg=nuGcsLT8QPsPMTjoh-uzAo2u+F6F5ivWC4pq0yBQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox