public inbox for [email protected]  
help / color / mirror / Atom feed
Downgrade pgsql 17 to pgsql 12 question
5+ messages / 5 participants
[nested] [flat]

* Downgrade pgsql 17 to pgsql 12 question
@ 2025-09-26 12:18 Ashish Mukherjee <[email protected]>
  2025-09-26 14:27 ` Re: Downgrade pgsql 17 to pgsql 12 question Laurenz Albe <[email protected]>
  2025-09-26 15:10 ` Re: Downgrade pgsql 17 to pgsql 12 question Adrian Klaver <[email protected]>
  0 siblings, 2 replies; 5+ messages in thread

From: Ashish Mukherjee @ 2025-09-26 12:18 UTC (permalink / raw)
  To: 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


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Downgrade pgsql 17 to pgsql 12 question
  2025-09-26 12:18 Downgrade pgsql 17 to pgsql 12 question Ashish Mukherjee <[email protected]>
@ 2025-09-26 14:27 ` Laurenz Albe <[email protected]>
  2025-09-26 14:39   ` Re: Downgrade pgsql 17 to pgsql 12 question Ron Johnson <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: Laurenz Albe @ 2025-09-26 14:27 UTC (permalink / raw)
  To: Ashish Mukherjee <[email protected]>; pgsql-general

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






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Downgrade pgsql 17 to pgsql 12 question
  2025-09-26 12:18 Downgrade pgsql 17 to pgsql 12 question Ashish Mukherjee <[email protected]>
  2025-09-26 14:27 ` Re: Downgrade pgsql 17 to pgsql 12 question Laurenz Albe <[email protected]>
@ 2025-09-26 14:39   ` Ron Johnson <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Ron Johnson @ 2025-09-26 14:39 UTC (permalink / raw)
  To: pgsql-general

On Fri, Sep 26, 2025 at 10:27 AM Laurenz Albe <[email protected]>
wrote:

> On Fri, 2025-09-26 at 17:48 +0530, Ashish Mukherjee wrote:
>
[snip]

> > 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.
>

Probably in the log_directory log file.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Downgrade pgsql 17 to pgsql 12 question
  2025-09-26 12:18 Downgrade pgsql 17 to pgsql 12 question Ashish Mukherjee <[email protected]>
@ 2025-09-26 15:10 ` Adrian Klaver <[email protected]>
  2025-09-26 15:13   ` Re: Downgrade pgsql 17 to pgsql 12 question Tom Lane <[email protected]>
  1 sibling, 1 reply; 5+ messages in thread

From: Adrian Klaver @ 2025-09-26 15:10 UTC (permalink / raw)
  To: Ashish Mukherjee <[email protected]>; pgsql-general

On 9/26/25 05:18, Ashish Mukherjee wrote:
> 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.
> 

What are the incompatibilities?

Might be easier to deal with those then doing the below.

> 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.

> Any input would be appreciated.
> 
> Regards,
> Ashish


-- 
Adrian Klaver
[email protected]






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Downgrade pgsql 17 to pgsql 12 question
  2025-09-26 12:18 Downgrade pgsql 17 to pgsql 12 question Ashish Mukherjee <[email protected]>
  2025-09-26 15:10 ` Re: Downgrade pgsql 17 to pgsql 12 question Adrian Klaver <[email protected]>
@ 2025-09-26 15:13   ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2025-09-26 15:13 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: Ashish Mukherjee <[email protected]>; pgsql-general

Adrian Klaver <[email protected]> writes:
> On 9/26/25 05:18, 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.

> What are the incompatibilities?
> Might be easier to deal with those then doing the below.

Yeah ... sitting on a PG release that's already a year beyond EOL
is not a sustainable practice.  You should consult the last several
release notes for v13 and reflect on the likelihood that most of those
bugs also exist in v12.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2025-09-26 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-26 12:18 Downgrade pgsql 17 to pgsql 12 question Ashish Mukherjee <[email protected]>
2025-09-26 14:27 ` Laurenz Albe <[email protected]>
2025-09-26 14:39   ` Ron Johnson <[email protected]>
2025-09-26 15:10 ` Adrian Klaver <[email protected]>
2025-09-26 15:13   ` Tom Lane <[email protected]>

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