pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedAW: pg_dump / pg_restore version confusion
4+ messages / 3 participants
[nested] [flat]
* AW: pg_dump / pg_restore version confusion
@ 2020-07-29 12:33 Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
0 siblings, 2 replies; 4+ messages in thread
From: Zwettler Markus (OIZ) @ 2020-07-29 12:33 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>
And I can also do this restore:
<quote>
Would a pg_restore with a v12 client into a postgres v9.6 database work and be officially supported?
</quote>
-Markus
> -----Ursprüngliche Nachricht-----
> Von: Bruce Momjian <bruce@momjian.us>
> Gesendet: Mittwoch, 29. Juli 2020 13:49
> An: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
> Cc: pgsql-general <pgsql-general@lists.postgresql.org>
> Betreff: Re: pg_dump / pg_restore version confusion
>
> On Wed, Jul 29, 2020 at 10:53:34AM +0000, Zwettler Markus (OIZ) wrote:
> > Hi,
> >
> >
> >
> > An external supplier had a postgres v9.5 database which he dumped with
> > a pg_dump v12 client in custom format using PgAdmin4.
> >
> >
> >
> > Would a pg_restore with a v12 client into a postgres v9.6 database
> > work and be officially supported?
>
> Yes, you can always use a newer pg_dump on an older database, though the
> reverse is not recommended. In fact, if you are upgrading to PG 12, it is
> recommended to use pg_dump v12 to dump a Postgres database from an earlier
> version.
>
> --
> Bruce Momjian <bruce@momjian.us> https://momjian.us
> EnterpriseDB https://enterprisedb.com
>
> The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 4+ messages in thread
* AW: pg_dump / pg_restore version confusion
@ 2020-07-29 13:38 Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
parent: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
1 sibling, 1 reply; 4+ messages in thread
From: Zwettler Markus (OIZ) @ 2020-07-29 13:38 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>
I cannot use pg_restore v9.6 on a pg_dump v12 because otherwise: pg_restore: [archiver] unsupported version (1.14) in file header
The external supplier did PG v9.5 database + pg_dump v12.
I would have to do pg_restore v12 (as of pg_dump v12) into my PG v9.6.
The version chain would be PG v9.5 => pg_dump v12 => pg_restore v12 => PG v9.6.
That's why my question has been: would the whole chain work and is it supported?
> -----Ursprüngliche Nachricht-----
> Von: Bruce Momjian <bruce@momjian.us>
> Gesendet: Mittwoch, 29. Juli 2020 14:55
> An: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
> Cc: pgsql-general <pgsql-general@lists.postgresql.org>
> Betreff: Re: pg_dump / pg_restore version confusion
>
> On Wed, Jul 29, 2020 at 12:33:56PM +0000, Zwettler Markus (OIZ) wrote:
> > And I can also do this restore:
> >
> > <quote>
> > Would a pg_restore with a v12 client into a postgres v9.6 database work and be
> officially supported?
> > </quote>
>
> Uh, good question. You should still use the version of pg_restore that you are
> loading _into_, not what you dumped from.
>
> --
> Bruce Momjian <bruce@momjian.us> https://momjian.us
> EnterpriseDB https://enterprisedb.com
>
> The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: AW: pg_dump / pg_restore version confusion
@ 2020-07-29 13:55 Adrian Klaver <adrian.klaver@aklaver.com>
parent: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
0 siblings, 0 replies; 4+ messages in thread
From: Adrian Klaver @ 2020-07-29 13:55 UTC (permalink / raw)
To: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>; Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>
On 7/29/20 6:38 AM, Zwettler Markus (OIZ) wrote:
> I cannot use pg_restore v9.6 on a pg_dump v12 because otherwise: pg_restore: [archiver] unsupported version (1.14) in file header
>
> The external supplier did PG v9.5 database + pg_dump v12.
> I would have to do pg_restore v12 (as of pg_dump v12) into my PG v9.6.
> The version chain would be PG v9.5 => pg_dump v12 => pg_restore v12 => PG v9.6.
>
> That's why my question has been: would the whole chain work and is it supported?
That is one way of attempting it, though it is not supported. You could
also try pg_restore v12 on pg_dump file v9.6 to Postgres v9.6 database
as well. With the caveats that I quoted in my previous post. Ideally you
would have the supplier redo the dump of the database with a 9.6 version
of pg_dump.
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: Bruce Momjian <bruce@momjian.us>
>> Gesendet: Mittwoch, 29. Juli 2020 14:55
>> An: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
>> Cc: pgsql-general <pgsql-general@lists.postgresql.org>
>> Betreff: Re: pg_dump / pg_restore version confusion
>>
>> On Wed, Jul 29, 2020 at 12:33:56PM +0000, Zwettler Markus (OIZ) wrote:
>>> And I can also do this restore:
>>>
>>> <quote>
>>> Would a pg_restore with a v12 client into a postgres v9.6 database work and be
>> officially supported?
>>> </quote>
>>
>> Uh, good question. You should still use the version of pg_restore that you are
>> loading _into_, not what you dumped from.
>>
>> --
>> Bruce Momjian <bruce@momjian.us> https://momjian.us
>> EnterpriseDB https://enterprisedb.com
>>
>> The usefulness of a cup is in its emptiness, Bruce Lee
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: AW: pg_dump / pg_restore version confusion
@ 2020-07-29 14:15 Tom Lane <tgl@sss.pgh.pa.us>
parent: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 2020-07-29 14:15 UTC (permalink / raw)
To: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-general <pgsql-general@lists.postgresql.org>
"Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch> writes:
> And I can also do this restore:
> <quote>
> Would a pg_restore with a v12 client into a postgres v9.6 database work and be officially supported?
> </quote>
It might work, but it's not completely guaranteed. Sometimes a new
pg_dump will use DDL syntax that doesn't exist in older versions,
even to describe constructs that do exist in older versions. This
isn't really common though.
I'd say try it and see. If the dump loads into 9.6 without errors then
it's probably fine (but you could dump again, with the same pg_dump
version, and diff the outputs to confirm).
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-07-29 14:15 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 12:33 AW: pg_dump / pg_restore version confusion Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-07-29 13:38 ` Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-07-29 13:55 ` Adrian Klaver <adrian.klaver@aklaver.com>
2020-07-29 14:15 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox