public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Pawel Veselov <[email protected]>
Cc: [email protected]
Subject: Re: Dump version issues
Date: Wed, 23 Apr 2025 15:06:16 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMnJ+Bet04kPY8KFxKA6tYaCGmxEhwvYoPZ1eGOHoVAJp=1rKA@mail.gmail.com>
References: <CAMnJ+Bet04kPY8KFxKA6tYaCGmxEhwvYoPZ1eGOHoVAJp=1rKA@mail.gmail.com>

Pawel Veselov <[email protected]> writes:
> Was trying to import a database from a cloud deployment, and ran into this.

> Exported the database with:
> * pg_dump (PostgreSQL) 12.20 (Ubuntu 12.20-0ubuntu0.20.04.1)
> * RDS PostgreSQL 12.19 on x86_64-pc-linux-gnu, compiled by gcc (GCC)
> 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit

> This produced a dump file of version 1.16, at least according to 'file'.

Better take another look at which pg_dump you used.  Archive version
1.16 was introduced in PG v17, according to a quick look at the source
code.  pg_restore versions older than v17 are not going to understand
it.

> I'm not sure whether the server has any say in the version of the dump
> file, I assume it doesn't.

Nope, just pg_dump.

> So, how come older software (according to versions) produces dump
> files with a greater version
> than the newer software can understand? Is this Ubuntu package
> maintainers messing things up?

You'd have to ask them.

> Given a pg_dump, it would be nice if its "-V" output would say which
> version of the dump it would produce,
> and a pg_restore - what's the max (and min, if that's a thing) version
> of the dump that it will accept.

Hmm, maybe.  The original thought was that the archive version would
seldom be a limiting factor: it describes the file format but not the
SQL inside the file, and that's often version-specific too.  So in
general we don't promise that pg_dump version N will produce output
that you can use with pg_restore or server versions less than N,
whether they share the same archive version or not.

			regards, tom lane






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], [email protected]
  Subject: Re: Dump version issues
  In-Reply-To: <[email protected]>

* 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